diff options
-rw-r--r-- | filters/f_decoder_wrapper.c | 7 | ||||
-rw-r--r-- | filters/f_decoder_wrapper.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/filters/f_decoder_wrapper.c b/filters/f_decoder_wrapper.c index 3f7fe50aad..31fb2997f0 100644 --- a/filters/f_decoder_wrapper.c +++ b/filters/f_decoder_wrapper.c @@ -1266,6 +1266,7 @@ void lavc_process(struct mp_filter *f, struct lavc_state *state, if (!state->eof_returned) mp_pin_in_write(f->ppins[1], MP_EOF_FRAME); state->eof_returned = true; + state->packets_sent = false; } else if (ret_recv == AVERROR(EAGAIN)) { // Need to feed a packet. frame = mp_pin_out_read(f->ppins[0]); @@ -1279,6 +1280,11 @@ void lavc_process(struct mp_filter *f, struct lavc_state *state, mp_filter_internal_mark_failed(f); } return; + } else if (!state->packets_sent) { + // EOF only; just return it, without requiring send/receive to + // pass it through properly. + mp_pin_in_write(f->ppins[1], MP_EOF_FRAME); + return; } int ret_send = send(f, pkt); if (ret_send == AVERROR(EAGAIN)) { @@ -1288,6 +1294,7 @@ void lavc_process(struct mp_filter *f, struct lavc_state *state, mp_filter_wakeup(f); return; } + state->packets_sent = true; talloc_free(pkt); mp_filter_internal_mark_progress(f); } else { diff --git a/filters/f_decoder_wrapper.h b/filters/f_decoder_wrapper.h index 51badaaabd..e6f7705b33 100644 --- a/filters/f_decoder_wrapper.h +++ b/filters/f_decoder_wrapper.h @@ -110,6 +110,7 @@ extern const struct mp_decoder_fns ad_spdif; // init to all-0 on init and resets. struct lavc_state { bool eof_returned; + bool packets_sent; }; void lavc_process(struct mp_filter *f, struct lavc_state *state, int (*send)(struct mp_filter *f, struct demux_packet *pkt), |