summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2019-09-16 23:28:31 +0800
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-09 13:39:10 +0100
commit5f31559107fa308263c5cbcc4546fb029feee428 (patch)
treebb612d038f4b98f84dc89ce07ea3484eb3394c1f
parentf31bbd0f7072d8bcf1441a017dd87bc9c0bd25d5 (diff)
libs: h264decoder: do not return error for unhandled NAL unit.
Some streams have error data introducing unknown NAL type. There are also kinds of NAL types we do not want to handle. The old manner will set a decoder error when encounter this, which cause a latent crash bug. The decoder may successfully decode the picture and insert it into DPB. But there are error NAL units after the AU which cause the post unit error and make that frame dropped. The later output of the picture still want to ref that frame and crash. No need to set decoder error when can not recognize or handle the NAL unit, just skip it and continue. Fix: #191
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_h264.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
index 0bc6fcde..891c0cfd 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
@@ -4319,9 +4319,22 @@ decode_unit (GstVaapiDecoderH264 * decoder, GstVaapiDecoderUnit * unit)
case GST_H264_NAL_SEI:
status = decode_sei (decoder, unit);
break;
+ case GST_H264_NAL_SLICE_DPA:
+ case GST_H264_NAL_SLICE_DPB:
+ case GST_H264_NAL_SLICE_DPC:
+ case GST_H264_NAL_AU_DELIMITER:
+ case GST_H264_NAL_FILLER_DATA:
+ case GST_H264_NAL_SPS_EXT:
+ case GST_H264_NAL_PREFIX_UNIT:
+ case GST_H264_NAL_DEPTH_SPS:
+ case GST_H264_NAL_SLICE_AUX:
+ case GST_H264_NAL_SLICE_DEPTH:
+ GST_DEBUG ("unsupported NAL unit type %d, just skip", pi->nalu.type);
+ status = GST_VAAPI_DECODER_STATUS_SUCCESS;
+ break;
default:
- GST_WARNING ("unsupported NAL unit type %d", pi->nalu.type);
- status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER;
+ GST_WARNING ("unknown NAL unit type id %d, skip", pi->nalu.type);
+ status = GST_VAAPI_DECODER_STATUS_SUCCESS;
break;
}
return status;