static int hevc_parse_nal_header(H2645NAL *nal, void *logctx)
{
GetBitContext *gb = &nal->gb;
- int nuh_layer_id;
if (get_bits1(gb) != 0)
return AVERROR_INVALIDDATA;
nal->type = get_bits(gb, 6);
- nuh_layer_id = get_bits(gb, 6);
+ nal->nuh_layer_id = get_bits(gb, 6);
nal->temporal_id = get_bits(gb, 3) - 1;
if (nal->temporal_id < 0)
return AVERROR_INVALIDDATA;
av_log(logctx, AV_LOG_DEBUG,
"nal_unit_type: %d(%s), nuh_layer_id: %d, temporal_id: %d\n",
- nal->type, hevc_nal_unit_name(nal->type), nuh_layer_id, nal->temporal_id);
+ nal->type, hevc_nal_unit_name(nal->type), nal->nuh_layer_id, nal->temporal_id);
- return nuh_layer_id == 0;
+ return 1;
}
static int h264_parse_nal_header(H2645NAL *nal, void *logctx)
for (i = 0; i < pkt.nb_nals; i++) {
H2645NAL *nal = &pkt.nals[i];
+ if (nal->nuh_layer_id > 0)
+ continue;
/* ignore everything except parameter sets and VCL NALUs */
switch (nal->type) {
H2645NAL *nal = &ctx->pkt.nals[i];
GetBitContext *gb = &nal->gb;
+ if (nal->nuh_layer_id > 0)
+ continue;
+
switch (nal->type) {
case HEVC_NAL_VPS:
ff_hevc_decode_nal_vps(gb, avctx, ps);
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);