Commit c707d0ca31 for ffmpeg
commit c707d0ca3164d6abd6dca3df97304d6feef0faf4
Author: Ronald S. Bultje <rsbultje@gmail.com>
Date: Fri Dec 4 12:54:05 2026 -0500
avcodec/hevc: drop the pending output frames when flushing
At the end of the stream, all remaining frames are moved to the output FIFO
at once. If the caller flushes the decoder (e.g. to seek) before it has
received all of them, they were still returned after the flush.
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 3bee36ef2f..64166baafa 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -5180,6 +5180,7 @@ static av_cold void hevc_decode_flush(AVCodecContext *avctx)
{
HEVCContext *s = avctx->priv_data;
ff_hevc_flush_dpb(s);
+ av_container_fifo_drain(s->output_fifo, av_container_fifo_can_read(s->output_fifo));
ff_hevc_reset_sei(&s->sei);
ff_dovi_ctx_flush(&s->dovi_ctx);
av_buffer_unref(&s->rpu_buf);