From 59f9547fb56b93356625c663dfe9978cbbf168ff Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 3 Feb 2018 23:21:35 +0100 Subject: vf_vapoursynth: always keep input frame array filled In theory (and practice), this is not needed, because the VS filter get frame callback will cause the process function to be called again if there's not enough data. But it's still a bit weird to just add one more frame on each iteration, so make it cleaner and make it request frames until the input array is full. --- video/filter/vf_vapoursynth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c index 3779400d9f..318eba5ee7 100644 --- a/video/filter/vf_vapoursynth.c +++ b/video/filter/vf_vapoursynth.c @@ -327,7 +327,7 @@ static void vf_vapoursynth_process(struct mp_filter *f) } // Read input and pass it to the input queue VS reads. - if (p->num_buffered < MP_TALLOC_AVAIL(p->buffered) && !p->eof) { + while (p->num_buffered < MP_TALLOC_AVAIL(p->buffered) && !p->eof) { // Note: this requests new input frames even if no output was ever // requested. Normally this is not how mp_filter works, but since VS // works asynchronously, it's probably ok. @@ -382,6 +382,8 @@ static void vf_vapoursynth_process(struct mp_filter *f) MP_ERR(p, "discarding unknown frame type\n"); mp_frame_unref(&frame); goto done; + } else { + break; // no new data available } } -- cgit v1.2.3