mirror of
https://github.com/mpv-player/mpv
synced 2025-01-21 23:23:19 +00:00
vf_format: fix forcing output format
This failed with an assert, because the format of the format of the output image was not set correctly.
This commit is contained in:
parent
52d1f3cc53
commit
3c9b464a73
@ -56,10 +56,20 @@ static int config(struct vf_instance *vf, int width, int height,
|
||||
return vf_next_config(vf, width, height, d_width, d_height, flags, vf->priv->outfmt);
|
||||
}
|
||||
|
||||
static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
|
||||
{
|
||||
// As documented in the manpage, the user can easily provoke crashes
|
||||
if (vf->priv->outfmt)
|
||||
mp_image_setfmt(mpi, vf->priv->outfmt);
|
||||
return mpi;
|
||||
}
|
||||
|
||||
static int vf_open(vf_instance_t *vf, char *args){
|
||||
vf->query_format=query_format;
|
||||
if (vf->priv->outfmt)
|
||||
if (vf->priv->outfmt) {
|
||||
vf->config=config;
|
||||
vf->filter=filter;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user