diff options
author | wm4 <wm4@nowhere> | 2013-01-17 16:23:01 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-17 16:40:07 +0100 |
commit | 3c9b464a7336f5942b6a736f26456689737473ce (patch) | |
tree | 0cb66149a0505e82fce5e1e91ac6cfbbeb8c513b | |
parent | 52d1f3cc533e28c81cd9807ddb0a51d0de543b9d (diff) | |
download | mpv-3c9b464a7336f5942b6a736f26456689737473ce.tar.bz2 mpv-3c9b464a7336f5942b6a736f26456689737473ce.tar.xz |
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.
-rw-r--r-- | video/filter/vf_format.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c index 71e3ad7669..d37778e38d 100644 --- a/video/filter/vf_format.c +++ b/video/filter/vf_format.c @@ -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; } |