mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
codecparsers: h264: handle end-of-seq and end-of-stream NAL gracefully.
This commit is contained in:
parent
ccfd761659
commit
d37f842aaa
1 changed files with 9 additions and 2 deletions
|
@ -1124,8 +1124,8 @@ gst_h264_parser_identify_nalu (GstH264NalParser * nalparser,
|
||||||
{
|
{
|
||||||
gint off1, off2;
|
gint off1, off2;
|
||||||
|
|
||||||
if (size - 4 <= offset) {
|
if (size - offset < 4) {
|
||||||
GST_DEBUG ("Can't parse, buffer is to small size %u, offset %u", size,
|
GST_DEBUG ("Can't parse, buffer has too small size %u, offset %u", size,
|
||||||
offset);
|
offset);
|
||||||
return GST_H264_PARSER_ERROR;
|
return GST_H264_PARSER_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1153,6 +1153,13 @@ gst_h264_parser_identify_nalu (GstH264NalParser * nalparser,
|
||||||
nalu->data = (guint8 *) data;
|
nalu->data = (guint8 *) data;
|
||||||
set_nalu_datas (nalu);
|
set_nalu_datas (nalu);
|
||||||
|
|
||||||
|
if (nalu->type == GST_H264_NAL_SEQ_END ||
|
||||||
|
nalu->type == GST_H264_NAL_STREAM_END) {
|
||||||
|
GST_DEBUG ("end-of-seq or end-of-stream nal found");
|
||||||
|
nalu->size = 0;
|
||||||
|
return GST_H264_PARSER_OK;
|
||||||
|
}
|
||||||
|
|
||||||
off2 = scan_for_start_codes (data + nalu->offset, size - nalu->offset);
|
off2 = scan_for_start_codes (data + nalu->offset, size - nalu->offset);
|
||||||
if (off2 < 0) {
|
if (off2 < 0) {
|
||||||
GST_DEBUG ("Nal start %d, No end found", nalu->offset);
|
GST_DEBUG ("Nal start %d, No end found", nalu->offset);
|
||||||
|
|
Loading…
Reference in a new issue