summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_vapoursynth.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/filter/vf_vapoursynth.c')
-rw-r--r--video/filter/vf_vapoursynth.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c
index db0bce3210..01cacbf742 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>
@@ -167,10 +168,10 @@ static void copy_mp_to_vs_frame_props_map(struct vf_priv_s *p, VSMap *map,
}
if (pict_type)
p->vsapi->propSetData(map, "_PictType", &pict_type, 1, 0);
- p->vsapi->propSetInt(map, "_FieldBased",
- !!(img->fields & MP_IMGFIELD_INTERLACED), 0);
- p->vsapi->propSetInt(map, "_Field",
- !!(img->fields & MP_IMGFIELD_TOP_FIRST), 0);
+ int field = 0;
+ if (img->fields & MP_IMGFIELD_INTERLACED)
+ field = img->fields & MP_IMGFIELD_TOP_FIRST ? 2 : 1;
+ p->vsapi->propSetInt(map, "_FieldBased", field, 0);
}
static int set_vs_frame_props(struct vf_priv_s *p, VSFrameRef *frame,
@@ -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");