mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
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:
parent
24bc53456c
commit
056a69cf2a
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue