Nevcairiel

Untitled

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