mpegvideoparse: Handle properly frame detection

Handle the case where we have buffers containing no startcode
in the middle of a frame properly.
This commit is contained in:
Thibault Saunier 2011-09-13 20:40:35 -03:00
parent f396baa3af
commit df551c0af4

View file

@ -493,9 +493,16 @@ end:
} else if (GST_BASE_PARSE_DRAINING (parse)) {
*framesize = GST_BUFFER_SIZE (buf);
ret = TRUE;
} else {
/* resume scan where we left it */
mpvparse->last_sc = GST_BUFFER_SIZE (buf);
if (!mpvparse->last_sc)
*skipsize = mpvparse->last_sc = GST_BUFFER_SIZE (buf) - 3;
else if (mpvparse->typeoffsize)
mpvparse->last_sc = GST_BUFFER_SIZE (buf) - 3;
else
*skipsize = 0;
/* request best next available */
*framesize = G_MAXUINT;
ret = FALSE;