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.
This commit is contained in:
Wim Taymans 2004-09-29 19:09:26 +00:00
parent 6033683b7c
commit 1fc1f89e91
3 changed files with 15 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2004-09-29 Wim Taymans <wim@fluendo.com>
* 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 <rbultje@ronald.bitfreak.net>
* ext/flac/gstflacdec.c: (gst_flacdec_src_query):

View file

@ -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;;

View file

@ -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;
}