From 3c9b464a7336f5942b6a736f26456689737473ce Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 17 Jan 2013 16:23:01 +0100 Subject: 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. --- video/filter/vf_format.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'video/filter') 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; } -- cgit v1.2.3