- update OFFSET field
authorWim Taymans <wim.taymans@gmail.com>
Sat, 24 May 2003 10:17:50 +0000 (10:17 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Sat, 24 May 2003 10:17:50 +0000 (10:17 +0000)
Original commit message from CVS:
- update OFFSET field
- flush unkown codes
- small cleanups

gst/mpegstream/gstmpegdemux.c
gst/mpegstream/gstmpegpacketize.c
gst/mpegstream/gstmpegparse.c

index 4beabe5..b86942a 100644 (file)
@@ -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);
     }
index 44ada2e..677346c 100644 (file)
@@ -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 {
index 5388d7c..2da4de1 100644 (file)
@@ -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;