diff options
authorwm4 <wm4@nowhere>2018-02-03 23:21:35 +0100
committerKevin Mitchell <>2018-02-03 14:51:33 -0800
commit59f9547fb56b93356625c663dfe9978cbbf168ff (patch)
parente34c5dc17c500b4b030b02255bb74012879d0ab1 (diff)
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.
1 files changed, 3 insertions, 1 deletions
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");
goto done;
+ } else {
+ break; // no new data available