summaryrefslogtreecommitdiff
path: root/libavcodec/hevcdec.c
diff options
context:
space:
mode:
authorAndriy Gelman <andriy.gelman@gmail.com>2019-12-05 22:15:41 -0500
committerJames Almer <jamrial@gmail.com>2020-01-17 17:43:52 -0300
commitad326379c6634505c9ebc46964057441761008bc (patch)
tree75af00b336830dbbfc9a1038511f00306d8df23b /libavcodec/hevcdec.c
parent5b7e90b252f765d677de6882bc65a362205638fa (diff)
lavc/h2645_parse: Don't automatically remove nuh_layer_id > 0 packets
HEVC standard supports multi-layer streams (ITU-T H.265 02/2018 Annex F). Each NAL unit belongs to a particular layer defined by nuh_layer_id in the header. Currently, all NAL units that do not belong to a base layer are automatically removed in ff_h2645_packet_split(). Some data may therefore be lost when future filters/decoders are designed to support multi-layer streams. A better approach is to forward nuh_layer_id > 0 packets and let blocks down the chain decide how to process them. The condition to remove packets has been moved to hevcdec and cbs. Found-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r--libavcodec/hevcdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 19b0cd815d..c74881e814 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3077,7 +3077,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
if (s->avctx->skip_frame >= AVDISCARD_ALL ||
(s->avctx->skip_frame >= AVDISCARD_NONREF
- && ff_hevc_nal_is_nonref(nal->type)))
+ && ff_hevc_nal_is_nonref(nal->type)) || nal->nuh_layer_id > 0)
continue;
ret = decode_nal_unit(s, nal);