diff options
author | wm4 <wm4@nowhere> | 2018-02-20 13:52:52 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-02-20 22:09:53 +0200 |
commit | ed13206a18f5f6fa7509144603f836ddacb59739 (patch) | |
tree | 86c25842f0f9ce24ec5391e523e9b6d4eafb281d | |
parent | 441e384390f1cd1b1b1c159cb797429432a09493 (diff) |
vf_vapoursynth: fix freeze
Commit 59f9547fb56b missed this case, in which we can't make new
progress and have to exit.
Fixes #5548.
-rw-r--r-- | video/filter/vf_vapoursynth.c | 12 |
1 files changed, 7 insertions, 5 deletions
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 |