h264parse: properly interpret baseparse draining state

... which means the input data has reached the end, but need not exclude
many separate frames may still need parsing.

Fixes merging NALs into AU.
This commit is contained in:
Mark Nauwelaerts 2011-10-06 12:25:26 +02:00
parent 3129ea29b1
commit 9c221f492d

View file

@ -613,7 +613,7 @@ gst_h264_parse_check_valid_frame (GstBaseParse * parse,
data = GST_BUFFER_DATA (buffer);
size = GST_BUFFER_SIZE (buffer);
drain = GST_BASE_PARSE_DRAINING (parse);
drain = FALSE;
current_off = h264parse->current_off;
GST_DEBUG_OBJECT (h264parse, "last parse position %u", current_off);
@ -665,8 +665,9 @@ gst_h264_parse_check_valid_frame (GstBaseParse * parse,
if (!h264parse->nalu.size && !h264parse->nalu.valid)
h264parse->nalu = nalu;
if (drain) {
GST_DEBUG_OBJECT (h264parse, "drainning NAL %u %u %u", size,
if (GST_BASE_PARSE_DRAINING (parse)) {
drain = TRUE;
GST_DEBUG_OBJECT (h264parse, "draining NAL %u %u %u", size,
h264parse->nalu.offset, h264parse->nalu.size);
/* Can't parse the nalu */
if (size - h264parse->nalu.offset < 2) {