summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-02-03 23:21:35 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-03 14:51:33 -0800
commit59f9547fb56b93356625c663dfe9978cbbf168ff (patch)
tree675b83e39c09e618eed2b3c1d72611179f167366
parente34c5dc17c500b4b030b02255bb74012879d0ab1 (diff)
downloadmpv-59f9547fb56b93356625c663dfe9978cbbf168ff.tar.bz2
mpv-59f9547fb56b93356625c663dfe9978cbbf168ff.tar.xz
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.
-rw-r--r--video/filter/vf_vapoursynth.c4
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");
mp_frame_unref(&frame);
goto done;
+ } else {
+ break; // no new data available
}
}