*skipsize = nalu.offset;
GST_DEBUG_OBJECT (h264parse, "skipping broken nal");
- return FALSE;
+ goto invalid;
} else {
nalu.size = 0;
goto end;
/* Can't parse the nalu */
if (size - h264parse->nalu.offset < 2) {
*skipsize = nalu.offset;
- return FALSE;
+ goto invalid;
}
/* We parse it anyway */
if (!h264parse->nalu.size) {
/* skip up to initial startcode */
*skipsize = h264parse->nalu.sc_offset;
+ /* but mind some stuff will have been skipped */
+ g_assert (current_off >= *skipsize);
+ current_off -= *skipsize;
+ h264parse->nalu.sc_offset = 0;
} else {
*skipsize = 0;
}
h264parse->current_off = current_off;
return FALSE;
+
+invalid:
+ gst_h264_parse_reset_frame (h264parse);
+ return FALSE;
}
/* byte together avc codec data based on collected pps and sps so far */