Disable SCR interpollation, it seems wrog add timestamps to private streams
authorWim Taymans <wim.taymans@gmail.com>
Mon, 27 May 2002 22:38:23 +0000 (22:38 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Mon, 27 May 2002 22:38:23 +0000 (22:38 +0000)
Original commit message from CVS:
Disable SCR interpollation, it seems wrog
add timestamps to private streams

gst/mpegstream/gstmpegdemux.c
gst/mpegstream/gstmpegdemux.h
gst/mpegstream/gstmpegparse.c

index a8dbbb0..461609d 100644 (file)
@@ -201,7 +201,7 @@ gst_mpeg_demux_init (GstMPEGDemux *mpeg_demux)
   /* i think everything is already zero'd, but oh well*/
   for (i=0;i<NUM_PRIVATE_1_PADS;i++) {
     mpeg_demux->private_1_pad[i] = NULL;
-    mpeg_demux->private_1_offset[i] = 0;
+    mpeg_demux->private_1_PTS[i] = 0;
   }
   for (i=0;i<NUM_SUBTITLE_PADS;i++) {
     mpeg_demux->subtitle_pad[i] = NULL;
@@ -582,14 +582,12 @@ done:
   /* if we don't know what it is, bail */
   if (outpad == NULL) {
     GST_DEBUG (0,"mpeg_demux::parse_packet: unknown packet id 0x%02X !!", id);
-    /* return total number of bytes */
     return FALSE;
   }
 
   /* FIXME, this should be done in parse_syshead */
   if ((*outpad) == NULL) {
     GST_DEBUG (0,"mpeg_demux::parse_packet: unexpected packet id 0x%02X!!", id);
-    /* return total number of bytes */
     return FALSE;
   }
 
@@ -712,6 +710,10 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
       /* scrap first 4 bytes (so-called "mystery AC3 tag") */
       headerlen += 4;
       datalen -= 4;
+      if (pts == -1) 
+        pts = mpeg_demux->private_1_PTS[ps_id_code - 0x80];
+      else 
+        mpeg_demux->private_1_PTS[ps_id_code - 0x80] = pts;
     }
     else if ((ps_id_code >= 0x20) && (ps_id_code <= 0x2f)) {
       GST_DEBUG (0,"mpeg_demux: we have a subtitle_stream packet, track %d",
@@ -808,7 +810,6 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
     gst_pad_push((*outpad),outbuf);
   }
 
-  /* return total number of bytes */
   return TRUE;
 }
 
index f30f2e5..dca16cc 100644 (file)
@@ -54,6 +54,13 @@ struct _MPEG1Stream {
   gint16 STD_buffer_size_bound;
 };
 
+typedef struct _GstMPEG1StreamContext GstMPEG1StreamContext;
+
+struct _GstMPEGStreamContext {
+  GstPad *pad;
+  guint64 pts;
+};
+
 struct _GstMPEGDemux {
   GstMPEGParse parent;
 
@@ -92,7 +99,7 @@ struct _GstMPEGDemux {
 
   /* stream output pads */
   GstPad *private_1_pad[NUM_PRIVATE_1_PADS];   /* up to 8 ac3 audio tracks */
-  gulong private_1_offset[NUM_PRIVATE_1_PADS];
+  gulong private_1_PTS[NUM_PRIVATE_1_PADS];
 
   GstPad *subtitle_pad[NUM_SUBTITLE_PADS];
   gulong subtitle_offset[NUM_SUBTITLE_PADS];
index a0b8851..387b092 100644 (file)
@@ -416,7 +416,7 @@ gst_mpeg_parse_loop (GstElement *element)
     size = GST_BUFFER_SIZE (data);
     
     /* we are interpolating the scr here */
-    mpeg_parse->current_scr += ((size * 90000LL) / (mpeg_parse->bit_rate));
+    /* mpeg_parse->current_scr += ((size * 90000LL) / (mpeg_parse->bit_rate)); */
   }
 }