vf: sanitize filter input, instead of overriding it

vf_fix_img_params() takes care of overwriting image parameters that are
normally not set correctly by filters. But this makes no sense for input
images. So instead, check that the input is correct.

It still has to be done for the first input image, because that's used
to handle some overrides (see video_reconfig_filters()).
This commit is contained in:
wm4 2014-05-01 23:06:23 +02:00
parent 4049532501
commit f4eaceee0f
1 changed files with 2 additions and 1 deletions

View File

@ -378,7 +378,7 @@ static int vf_do_filter(struct vf_instance *vf, struct mp_image *img)
{ {
assert(vf->fmt_in.imgfmt); assert(vf->fmt_in.imgfmt);
if (img) if (img)
vf_fix_img_params(img, &vf->fmt_in); assert(mp_image_params_equals(&img->params, &vf->fmt_in));
if (vf->filter_ext) { if (vf->filter_ext) {
int r = vf->filter_ext(vf, img); int r = vf->filter_ext(vf, img);
@ -404,6 +404,7 @@ int vf_filter_frame(struct vf_chain *c, struct mp_image *img)
talloc_free(img); talloc_free(img);
return -1; return -1;
} }
vf_fix_img_params(img, &c->input_params);
return vf_do_filter(c->first, img); return vf_do_filter(c->first, img);
} }