vaapidecoder_h265: 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 19:03:44 -03:00 committed by Víctor Manuel Jáquez Leal
parent 056a69cf2a
commit 1f71503fc9

View file

@ -2779,9 +2779,12 @@ gst_vaapi_decoder_h265_parse (GstVaapiDecoder * base_decoder,
} else {
if (size < 4)
return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA;
if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H265_NALU)
if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H265_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;