summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-20 21:05:42 +0200
committerwm4 <wm4@nowhere>2015-04-20 21:05:42 +0200
commita1e410e43a7d1cf638f9ce278ec8b7727ae9a32f (patch)
tree8379276155bcd508a2aeef6d4c57f237c31e8236
parentc6d046414b1d31046c39da6399130b39fe54813d (diff)
downloadmpv-a1e410e43a7d1cf638f9ce278ec8b7727ae9a32f.tar.bz2
mpv-a1e410e43a7d1cf638f9ce278ec8b7727ae9a32f.tar.xz
vf_vapoursynth: stupid hack to unbreak with recent API change
Vapoursynth made an incompatible API change: clips with unknown length are not supported anymore. In fact, Vapoursynth abort()s the program (which by the way invalidate all of its claims of API/ABI stability). So add some nonsense to make it work again.
-rw-r--r--video/filter/vf_vapoursynth.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c
index db0bce3210..8e3854442d 100644
--- a/video/filter/vf_vapoursynth.c
+++ b/video/filter/vf_vapoursynth.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <inttypes.h>
#include <pthread.h>
+#include <limits.h>
#include <assert.h>
#include <VapourSynth.h>
@@ -407,6 +408,10 @@ static void VS_CC infiltInit(VSMap *in, VSMap *out, void **instanceData,
{
struct vf_instance *vf = *instanceData;
struct vf_priv_s *p = vf->priv;
+ // The number of frames of our input node is obviously unknown. The user
+ // could for example seek any time, randomly "ending" the clip.
+ // This specific value was suggested by the VapourSynth developer.
+ int enough_for_everyone = INT_MAX / 16;
// Note: this is called from createFilter, so no need for locking.
@@ -414,6 +419,7 @@ static void VS_CC infiltInit(VSMap *in, VSMap *out, void **instanceData,
.format = p->vsapi->getFormatPreset(mp_to_vs(p->fmt_in.imgfmt), p->vscore),
.width = p->fmt_in.w,
.height = p->fmt_in.h,
+ .numFrames = enough_for_everyone,
};
if (!fmt.format) {
p->vsapi->setError(out, "Unsupported input format.\n");