diff options
author | wm4 <wm4@nowhere> | 2014-10-11 18:17:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-11 18:17:20 +0200 |
commit | 227e470ee213b6618c080ae654cc947b4adb0add (patch) | |
tree | 53a57c574e224ba621dce0915700e872d7f69d74 /video | |
parent | 46b16cf2063ea9a5032feead581ebe77e8001604 (diff) | |
download | mpv-227e470ee213b6618c080ae654cc947b4adb0add.tar.bz2 mpv-227e470ee213b6618c080ae654cc947b4adb0add.tar.xz |
vf_vapoursynth: return dummy frames if frames are requested during init
An attempt at fixing #1168.
I see black frames flashing, so it's certainly not perfect.
Diffstat (limited to 'video')
-rw-r--r-- | video/filter/vf_vapoursynth.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c index ea5b3fe1cc..8b4d52cad0 100644 --- a/video/filter/vf_vapoursynth.c +++ b/video/filter/vf_vapoursynth.c @@ -401,7 +401,18 @@ static const VSFrameRef *VS_CC infiltGetFrame(int frameno, int activationReason, break; } if (p->initializing) { - p->vsapi->setFilterError("Frame requested during init", frameCtx); + MP_WARN(vf, "Frame requested during init! This is unsupported.\n" + "Returning black dummy frame with 0 duration.\n"); + ret = alloc_vs_frame(p, &vf->fmt_in); + if (!ret) { + p->vsapi->setFilterError("Could not allocate VS frame", frameCtx); + break; + } + struct mp_image vsframe = map_vs_frame(p, ret, true); + mp_image_clear(&vsframe, 0, 0, vf->fmt_in.w, vf->fmt_in.h); + struct mp_image dummy = {0}; + mp_image_set_params(&dummy, &vf->fmt_in); + set_vs_frame_props(p, ret, &dummy, 0, 1); break; } if (frameno < p->in_frameno) { |