From 1fc1f89e9187d30206236072c578679d91814c93 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 29 Sep 2004 19:09:26 +0000 Subject: [PATCH] gst/mpegstream/: Fix playback of mpeg again, timestamps where screwed up by patch 1.61. Original commit message from CVS: * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes): * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_parse_packhead): Fix playback of mpeg again, timestamps where screwed up by patch 1.61. --- ChangeLog | 8 ++++++++ gst/mpegstream/gstmpegdemux.c | 12 ++++++------ gst/mpegstream/gstmpegparse.c | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index a38fdd0..9ba7d02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-09-29 Wim Taymans + + * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_parse_packet), + (gst_mpeg_demux_parse_pes): + * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_parse_packhead): + Fix playback of mpeg again, timestamps where screwed up by + patch 1.61. + 2004-09-29 Ronald S. Bultje * ext/flac/gstflacdec.c: (gst_flacdec_src_query): diff --git a/gst/mpegstream/gstmpegdemux.c b/gst/mpegstream/gstmpegdemux.c index 69934f6..252eb0f 100644 --- a/gst/mpegstream/gstmpegdemux.c +++ b/gst/mpegstream/gstmpegdemux.c @@ -680,9 +680,9 @@ gst_mpeg_demux_parse_packet (GstMPEGParse * mpeg_parse, GstBuffer * buffer) case 0x20: /* pts:3 ! 1 ! pts:15 ! 1 | pts:15 ! 1 */ pts = ((guint64) (bits & 0x0E)) << 29; - pts |= ((guint64) * buf++) << 22; + pts |= ((guint64) (*buf++)) << 22; pts |= ((guint64) (*buf++ & 0xFE)) << 14; - pts |= ((guint64) * buf++) << 7; + pts |= ((guint64) (*buf++)) << 7; pts |= ((guint64) (*buf++ & 0xFE)) >> 1; GST_DEBUG_OBJECT (mpeg_demux, "PTS = %" G_GUINT64_FORMAT, pts); @@ -691,9 +691,9 @@ gst_mpeg_demux_parse_packet (GstMPEGParse * mpeg_parse, GstBuffer * buffer) case 0x30: /* pts:3 ! 1 ! pts:15 ! 1 | pts:15 ! 1 */ pts = ((guint64) (bits & 0x0E)) << 29; - pts |= ((guint64) * buf++) << 22; + pts |= ((guint64) (*buf++)) << 22; pts |= ((guint64) (*buf++ & 0xFE)) << 14; - pts |= ((guint64) * buf++) << 7; + pts |= ((guint64) (*buf++)) << 7; pts |= ((guint64) (*buf++ & 0xFE)) >> 1; /* sync:4 ! pts:3 ! 1 ! pts:15 ! 1 | pts:15 ! 1 */ @@ -824,8 +824,8 @@ gst_mpeg_demux_parse_pes (GstMPEGParse * mpeg_parse, GstBuffer * buffer) pts |= ((guint64) * buf++) << 7; pts |= ((guint64) (*buf++ & 0xFE)) >> 1; - GST_DEBUG_OBJECT (mpeg_demux, "0x%02x PTS = %" G_GUINT64_FORMAT, - id, MPEGTIME_TO_GSTTIME (pts)); + GST_DEBUG_OBJECT (mpeg_demux, "0x%02x (%lld) PTS = %" G_GUINT64_FORMAT, + id, pts, MPEGTIME_TO_GSTTIME (pts)); pts += mpeg_parse->adjust; timestamp = MPEGTIME_TO_GSTTIME (pts) + mpeg_demux->adjust;; diff --git a/gst/mpegstream/gstmpegparse.c b/gst/mpegstream/gstmpegparse.c index b288f50..415f2dd 100644 --- a/gst/mpegstream/gstmpegparse.c +++ b/gst/mpegstream/gstmpegparse.c @@ -440,11 +440,11 @@ gst_mpeg_parse_parse_packhead (GstMPEGParse * mpeg_parse, GstBuffer * buffer) (double) mpeg_parse->bytes_since_scr / MPEGTIME_TO_GSTTIME (mpeg_parse->current_scr - prev_scr) / 50 * 1000000000; - mpeg_parse->bytes_since_scr = 0; //gst_mpeg_parse_update_streaminfo (mpeg_parse); GST_DEBUG ("stream is %1.3fMbs", (mpeg_parse->mux_rate * 400) / 1000000.0); } + mpeg_parse->bytes_since_scr = 0; return TRUE; } -- 2.7.4