diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-10-30 20:52:40 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-10-31 03:25:59 +0000 |
commit | 908e75ee83a2afed92285ce97ea23737836b86bc (patch) | |
tree | 9fe3caf4a422ac4b81166ff2729f84680139d21e /video/filter/vf_vapoursynth.c | |
parent | cb2b579f61764452652c6cf5c6a94ae5e67c77ed (diff) | |
download | mpv-908e75ee83a2afed92285ce97ea23737836b86bc.tar.bz2 mpv-908e75ee83a2afed92285ce97ea23737836b86bc.tar.xz |
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
Diffstat (limited to 'video/filter/vf_vapoursynth.c')
-rw-r--r-- | video/filter/vf_vapoursynth.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |