From ccc2d53203ebdfb3f3221877137c6b9dcf996df8 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 27 May 2002 22:38:23 +0000 Subject: [PATCH] Disable SCR interpollation, it seems wrog add timestamps to private streams Original commit message from CVS: Disable SCR interpollation, it seems wrog add timestamps to private streams --- gst/mpegstream/gstmpegdemux.c | 9 +++++---- gst/mpegstream/gstmpegdemux.h | 9 ++++++++- gst/mpegstream/gstmpegparse.c | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gst/mpegstream/gstmpegdemux.c b/gst/mpegstream/gstmpegdemux.c index a8dbbb0..461609d 100644 --- a/gst/mpegstream/gstmpegdemux.c +++ b/gst/mpegstream/gstmpegdemux.c @@ -201,7 +201,7 @@ gst_mpeg_demux_init (GstMPEGDemux *mpeg_demux) /* i think everything is already zero'd, but oh well*/ for (i=0;iprivate_1_pad[i] = NULL; - mpeg_demux->private_1_offset[i] = 0; + mpeg_demux->private_1_PTS[i] = 0; } for (i=0;isubtitle_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; } diff --git a/gst/mpegstream/gstmpegdemux.h b/gst/mpegstream/gstmpegdemux.h index f30f2e5..dca16cc 100644 --- a/gst/mpegstream/gstmpegdemux.h +++ b/gst/mpegstream/gstmpegdemux.h @@ -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]; diff --git a/gst/mpegstream/gstmpegparse.c b/gst/mpegstream/gstmpegparse.c index a0b8851..387b092 100644 --- a/gst/mpegstream/gstmpegparse.c +++ b/gst/mpegstream/gstmpegparse.c @@ -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)); */ } } -- 2.7.4