*/
static GstMpeg4ParseResult
gst_mpeg4_next_resync (GstMpeg4Packet * packet,
- const GstMpeg4VideoObjectPlane * vop, const guint8 * data, gsize size)
+ const GstMpeg4VideoObjectPlane * vop, const guint8 * data, gsize size,
+ gboolean first_resync_marker)
{
guint markersize = 0, off1, off2;
guint32 mask = 0xff, pattern = 0xff;
markersize = compute_resync_marker_size (vop, &pattern, &mask);
- off1 = gst_byte_reader_masked_scan_uint32 (&br, mask, pattern, 0, size);
+ if (first_resync_marker) {
+ off1 = 0;
+ } else {
+ off1 = gst_byte_reader_masked_scan_uint32 (&br, mask, pattern, 0, size);
+ }
if (off1 == -1)
return GST_MPEG4_PARSER_NO_PACKET;
gint off1, off2;
GstByteReader br;
GstMpeg4ParseResult resync_res;
+ static guint first_resync_marker = TRUE;
gst_byte_reader_init (&br, data, size);
if (vop) {
resync_res =
- gst_mpeg4_next_resync (packet, vop, data + offset, size - offset);
+ gst_mpeg4_next_resync (packet, vop, data + offset, size - offset,
+ first_resync_marker);
+ first_resync_marker = FALSE;
/* We found a complet slice */
if (resync_res == GST_MPEG4_PARSER_OK)
goto find_end;
} else if (resync_res == GST_MPEG4_PARSER_NO_PACKET)
return resync_res;
+ } else {
+ first_resync_marker = TRUE;
}
off1 = gst_byte_reader_masked_scan_uint32 (&br, 0xffffff00, 0x00000100,