mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
h264parse: Stop considering NO_NAL as an error
The NO_NAL return value simply means that the buffer did not contain enough data to identity a NAL. This should lead to waiting for more data not considering the stream as invalid. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3234>
This commit is contained in:
parent
0780e31581
commit
9deb3d6aa4
1 changed files with 9 additions and 7 deletions
|
@ -1417,9 +1417,8 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
|
|||
}
|
||||
break;
|
||||
case GST_H264_PARSER_NO_NAL:
|
||||
/* Start code may have up to 4 bytes */
|
||||
*skipsize = size - 4;
|
||||
goto skip;
|
||||
/* we don't have enough bytes to make any decisions yet */
|
||||
goto more;
|
||||
break;
|
||||
default:
|
||||
/* should not really occur either */
|
||||
|
@ -1443,6 +1442,13 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
|
|||
GST_DEBUG_OBJECT (h264parse, "complete nal (offset, size): (%u, %u) ",
|
||||
nalu.offset, nalu.size);
|
||||
break;
|
||||
case GST_H264_PARSER_NO_NAL:
|
||||
/* In NAL alignment, assume the NAL is broken */
|
||||
if (h264parse->in_align == GST_H264_PARSE_ALIGN_NAL ||
|
||||
h264parse->in_align == GST_H264_PARSE_ALIGN_AU) {
|
||||
goto broken;
|
||||
}
|
||||
goto more;
|
||||
case GST_H264_PARSER_NO_NAL_END:
|
||||
/* In NAL alignment, assume the NAL is complete */
|
||||
if (h264parse->in_align == GST_H264_PARSE_ALIGN_NAL ||
|
||||
|
@ -1476,10 +1482,6 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
|
|||
GST_ELEMENT_ERROR (h264parse, STREAM, FORMAT,
|
||||
("Error parsing H.264 stream"), ("Invalid H.264 stream"));
|
||||
goto invalid_stream;
|
||||
case GST_H264_PARSER_NO_NAL:
|
||||
GST_ELEMENT_ERROR (h264parse, STREAM, FORMAT,
|
||||
("Error parsing H.264 stream"), ("No H.264 NAL unit found"));
|
||||
goto invalid_stream;
|
||||
case GST_H264_PARSER_BROKEN_DATA:
|
||||
GST_WARNING_OBJECT (h264parse, "input stream is corrupt; "
|
||||
"it contains a NAL unit of length %u", nalu.size);
|
||||
|
|
Loading…
Reference in a new issue