vaapidecoder_h264: fix parsing of NALU aligned data

Don't assume the whole buffer is a single NAL, instead look for the
next start code in case there are multiple NALs per buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=762328
This commit is contained in:
Thiago Santos 2016-02-19 11:10:25 -03:00 committed by Víctor Manuel Jáquez Leal
parent 24bc53456c
commit 056a69cf2a

View file

@ -4382,9 +4382,12 @@ gst_vaapi_decoder_h264_parse (GstVaapiDecoder * base_decoder,
if (size < 4)
return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA;
if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H264_NALU)
if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H264_NALU) {
buf_size = size;
else {
ofs = scan_for_start_code (adapter, 4, size - 4, NULL);
if (ofs > 0)
buf_size = ofs;
} else {
ofs = scan_for_start_code (adapter, 0, size, NULL);
if (ofs < 0)
return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA;