summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf_format.c12
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;
}