1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-08 02:22:47 +00:00

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.
This commit is contained in:
wm4 2018-02-03 23:21:35 +01:00 committed by Kevin Mitchell
parent e34c5dc17c
commit 59f9547fb5

View File

@ -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
}
}