Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 1836a88926907664f15271e69ced8baebad360d0 Mon Sep 17 00:00:00 2001
- From: Hendrik Leppkes <[email protected]>
- Date: Tue, 28 Dec 2021 14:38:10 +0100
- Subject: [PATCH] hevcdec: skip slices with missing PPS instead of skipping the
- entire packet
- Aborting decoding of the entire packet on a missing PPS can result in
- missing the actual PPS on streams with badly ordered NALs, where the
- SPS/PPS/VPS are stitched to the back of the previous frame, instead of
- the beginning of the next frame.
- Instead, skip the undecodable slice, and let the decoder process further
- NALs in the same packet.
- ---
- libavcodec/hevcdec.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
- index 3aa70e2245..c2451d682e 100644
- --- a/libavcodec/hevcdec.c
- +++ b/libavcodec/hevcdec.c
- @@ -575,7 +575,7 @@ static int hls_slice_header(HEVCContext *s)
- sh->pps_id = get_ue_golomb_long(gb);
- if (sh->pps_id >= HEVC_MAX_PPS_COUNT || !s->ps.pps_list[sh->pps_id]) {
- av_log(s->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", sh->pps_id);
- - return AVERROR_INVALIDDATA;
- + return 1; // skip slice with missing PPS
- }
- if (!sh->first_slice_in_pic_flag &&
- s->ps.pps != (HEVCPPS*)s->ps.pps_list[sh->pps_id]->data) {
- --
- 2.33.0.windows.2
Advertisement
Add Comment
Please, Sign In to add comment