h264parse: some more proper parse state reset

This commit is contained in:
Mark Nauwelaerts 2012-01-03 20:21:51 +01:00
parent 51f399686e
commit c54144cc16

View file

@ -179,6 +179,7 @@ gst_h264_parse_reset_frame (GstH264Parse * h264parse)
/* done parsing; reset state */ /* done parsing; reset state */
h264parse->nalu.valid = FALSE; h264parse->nalu.valid = FALSE;
h264parse->nalu.offset = 0; h264parse->nalu.offset = 0;
h264parse->nalu.sc_offset = 0;
h264parse->nalu.size = 0; h264parse->nalu.size = 0;
h264parse->current_off = 0; h264parse->current_off = 0;
@ -617,7 +618,7 @@ gst_h264_parse_check_valid_frame (GstBaseParse * parse,
guint size, current_off = 0; guint size, current_off = 0;
gboolean drain; gboolean drain;
GstH264NalParser *nalparser = h264parse->nalparser; GstH264NalParser *nalparser = h264parse->nalparser;
GstH264NalUnit nalu = h264parse->nalu; GstH264NalUnit nalu;
/* expect at least 3 bytes startcode == sc, and 2 bytes NALU payload */ /* expect at least 3 bytes startcode == sc, and 2 bytes NALU payload */
if (G_UNLIKELY (GST_BUFFER_SIZE (buffer) < 5)) if (G_UNLIKELY (GST_BUFFER_SIZE (buffer) < 5))
@ -640,6 +641,7 @@ gst_h264_parse_check_valid_frame (GstBaseParse * parse,
size = GST_BUFFER_SIZE (buffer); size = GST_BUFFER_SIZE (buffer);
drain = FALSE; drain = FALSE;
nalu = h264parse->nalu;
current_off = h264parse->current_off; current_off = h264parse->current_off;
GST_DEBUG_OBJECT (h264parse, "last parse position %u", current_off); GST_DEBUG_OBJECT (h264parse, "last parse position %u", current_off);