From 908e75ee83a2afed92285ce97ea23737836b86bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Mon, 30 Oct 2023 20:52:40 +0100 Subject: vf_vapoursynth: set crop metadata after mapping vapoursynth frame Vapoursynth does not provide crop metadata and input one is likely to be invalidated during filtering. Set crop to full frame if image dimensions were changed during filtering. Fixes: #12780 --- video/filter/vf_vapoursynth.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'video/filter') diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c index 1183d90e8b..d4806c49ad 100644 --- a/video/filter/vf_vapoursynth.c +++ b/video/filter/vf_vapoursynth.c @@ -270,6 +270,8 @@ static void VS_CC vs_frame_done(void *userData, const VSFrameRef *f, int n, if (f) { struct mp_image img = map_vs_frame(p, f, false); struct mp_image dummy = {.params = p->fmt_in}; + if (p->fmt_in.w != img.w || p->fmt_in.h != img.h) + dummy.params.crop = (struct mp_rect){0, 0, img.w, img.h}; mp_image_copy_attributes(&img, &dummy); img.pkt_duration = -1; const VSMap *map = p->vsapi->getFramePropsRO(f); -- cgit v1.2.3