From ed13206a18f5f6fa7509144603f836ddacb59739 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 20 Feb 2018 13:52:52 +0100 Subject: vf_vapoursynth: fix freeze Commit 59f9547fb56b missed this case, in which we can't make new progress and have to exit. Fixes #5548. --- video/filter/vf_vapoursynth.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'video/filter/vf_vapoursynth.c') diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c index 318eba5ee7..5077f4cf19 100644 --- a/video/filter/vf_vapoursynth.c +++ b/video/filter/vf_vapoursynth.c @@ -333,17 +333,19 @@ static void vf_vapoursynth_process(struct mp_filter *f) // works asynchronously, it's probably ok. struct mp_frame frame = mp_pin_out_read(p->in_pin); if (frame.type == MP_FRAME_EOF) { - if (p->out_node) { + if (p->out_node && !p->eof) { MP_VERBOSE(p, "initiate EOF\n"); p->eof = true; pthread_cond_broadcast(&p->wakeup); - } else if (mp_pin_in_needs_data(f->ppins[1])) { + } + if (!p->out_node && mp_pin_in_needs_data(f->ppins[1])) { MP_VERBOSE(p, "return EOF\n"); mp_pin_in_write(f->ppins[1], frame); - frame = MP_NO_FRAME; + } else { + // Keep it until we can propagate it. + mp_pin_out_unread(p->in_pin, frame); + break; } - // Keep it until we can propagate it. - mp_pin_out_unread(p->in_pin, frame); } else if (frame.type == MP_FRAME_VIDEO) { struct mp_image *mpi = frame.data; // Init VS script, or reinit it to change video format. (This -- cgit v1.2.3