From 1ac987493768a11bebd80e09101574dcaf7419d3 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 24 May 2003 10:17:50 +0000 Subject: [PATCH] - update OFFSET field Original commit message from CVS: - update OFFSET field - flush unkown codes - small cleanups --- gst/mpegstream/gstmpegdemux.c | 2 ++ gst/mpegstream/gstmpegpacketize.c | 1 + gst/mpegstream/gstmpegparse.c | 8 ++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gst/mpegstream/gstmpegdemux.c b/gst/mpegstream/gstmpegdemux.c index 4beabe5b8d..b86942a7d8 100644 --- a/gst/mpegstream/gstmpegdemux.c +++ b/gst/mpegstream/gstmpegdemux.c @@ -675,6 +675,7 @@ done: outbuf = gst_buffer_create_sub (buffer, headerlen + 4, datalen); GST_BUFFER_TIMESTAMP (outbuf) = timestamp; + GST_BUFFER_OFFSET (outbuf) = GST_BUFFER_OFFSET (buffer) + headerlen + 4; GST_DEBUG (0, "pushing buffer of len %d id %d, ts %" G_GINT64_FORMAT, datalen, id, GST_BUFFER_TIMESTAMP (outbuf)); @@ -951,6 +952,7 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer) outbuf = gst_buffer_create_sub (buffer, headerlen+4, datalen); GST_BUFFER_TIMESTAMP (outbuf) = timestamp; + GST_BUFFER_OFFSET (outbuf) = GST_BUFFER_OFFSET (buffer) + headerlen + 4; gst_pad_push(*outpad,outbuf); } diff --git a/gst/mpegstream/gstmpegpacketize.c b/gst/mpegstream/gstmpegpacketize.c index 44ada2e465..677346cc87 100644 --- a/gst/mpegstream/gstmpegpacketize.c +++ b/gst/mpegstream/gstmpegpacketize.c @@ -255,6 +255,7 @@ gst_mpeg_packetize_read (GstMPEGPacketize *packetize) break; default: if (packetize->MPEG2 && ((packetize->id < 0xBD) || (packetize->id > 0xFE))) { + gst_bytestream_flush (packetize->bs, 4); g_warning ("packetize: ******** unknown id 0x%02X",packetize->id); } else { diff --git a/gst/mpegstream/gstmpegparse.c b/gst/mpegstream/gstmpegparse.c index 5388d7c3c9..2da4de11b9 100644 --- a/gst/mpegstream/gstmpegparse.c +++ b/gst/mpegstream/gstmpegparse.c @@ -359,7 +359,9 @@ gst_mpeg_parse_parse_packhead (GstMPEGParse *mpeg_parse, GstBuffer *buffer) mpeg_parse->next_scr = scr; } - GST_DEBUG (0, "SCR is %" G_GUINT64_FORMAT " (%" G_GUINT64_FORMAT ") next: %" G_GINT64_FORMAT " (%" G_GINT64_FORMAT ") diff: %" G_GINT64_FORMAT " (%" G_GINT64_FORMAT ")", + GST_DEBUG (0, "SCR is %" G_GUINT64_FORMAT " (%" G_GUINT64_FORMAT ") next: %" + G_GINT64_FORMAT " (%" G_GINT64_FORMAT ") diff: %" G_GINT64_FORMAT " (%" + G_GINT64_FORMAT ")", scr, MPEGTIME_TO_GSTTIME (scr), mpeg_parse->next_scr, @@ -369,7 +371,9 @@ gst_mpeg_parse_parse_packhead (GstMPEGParse *mpeg_parse, GstBuffer *buffer) MPEGTIME_TO_GSTTIME (mpeg_parse->next_scr)); if (ABS ((gint64)mpeg_parse->next_scr - (gint64)(scr_adj)) > mpeg_parse->max_discont) { - GST_DEBUG (0, "discontinuity detected; expected: %" G_GUINT64_FORMAT " got: %" G_GUINT64_FORMAT " real:%" G_GINT64_FORMAT " adjust:%" G_GINT64_FORMAT, + GST_DEBUG (0, "discontinuity detected; expected: %" + G_GUINT64_FORMAT " got: %" G_GUINT64_FORMAT " real:%" + G_GINT64_FORMAT " adjust:%" G_GINT64_FORMAT, mpeg_parse->next_scr, scr_adj, scr, mpeg_parse->adjust); mpeg_parse->adjust = mpeg_parse->next_scr - scr;