Commit ffa80239 authored by Nicolas Dufresne's avatar Nicolas Dufresne
Browse files

h26xparse: Handle the case we already parsed the frame

As we no longer accumulate 2 NALs before producing any data, we may
endup with the case where we have completly parsed the frame data and
then get called on handle_frame(). This was triggering the assertion
current_off < size, as the current offset was equal to the size.
Handle this just like we'd do in other case, like broken NAL etc.
parent 7bcb43cf
......@@ -1108,8 +1108,19 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
nonext = FALSE;
current_off = h264parse->current_off;
if (current_off < 0)
current_off = 0;
/* The parser is being drain, but no new data was added, just prentend this
* AU is complete */
if (drain && current_off == size) {
GST_DEBUG_OBJECT (h264parse, "draining with no new data");
nalu.size = 0;
nalu.offset = current_off;
goto end;
}
g_assert (current_off < size);
GST_DEBUG_OBJECT (h264parse, "last parse position %d", current_off);
......
......@@ -951,8 +951,19 @@ gst_h265_parse_handle_frame (GstBaseParse * parse,
nonext = FALSE;
current_off = h265parse->current_off;
if (current_off < 0)
current_off = 0;
/* The parser is being drain, but no new data was added, just prentend this
* AU is complete */
if (drain && current_off == size) {
GST_DEBUG_OBJECT (h265parse, "draining with no new data");
nalu.size = 0;
nalu.offset = current_off;
goto end;
}
g_assert (current_off < size);
GST_DEBUG_OBJECT (h265parse, "last parse position %d", current_off);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment