avcodec/hevc/refs: don't unconditionally discard non-IRAP frames if no IRAP frame was seen before

Should fix issue #20661

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 4377affc28d92f759d1de15ac68ce07b1aa48810)
This commit is contained in:
James Almer 2025-10-07 15:39:34 -03:00
parent d8605a6b55
commit d961a634fb

View file

@ -235,6 +235,7 @@ int ff_hevc_set_new_ref(HEVCContext *s, HEVCLayerContext *l, int poc)
s->layers[0].cur_frame - s->layers[0].DPB : -1;
no_output = !IS_IRAP(s) && (s->poc < s->recovery_poc) &&
HEVC_IS_RECOVERING(s) &&
!(s->avctx->flags & AV_CODEC_FLAG_OUTPUT_CORRUPT) &&
!(s->avctx->flags2 & AV_CODEC_FLAG2_SHOW_ALL);
if (s->sh.pic_output_flag && !no_output)