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
This commit is contained in:
Kacper Michajłow 2023-10-30 20:52:40 +01:00 committed by Dudemanguy
parent cb2b579f61
commit 908e75ee83
1 changed files with 2 additions and 0 deletions

View File

@ -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);