[0.11] gst-plugins-bad: mpegpsdemux: don' t scan for the last PTS if the first wasn't found
Sebastian Dröge
slomo at kemper.freedesktop.org
Wed Jan 25 04:24:03 PST 2012
Module: gst-plugins-bad
Branch: 0.11
Commit: 0961e2f49464f2762228ce24af48a53616e52da0
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=0961e2f49464f2762228ce24af48a53616e52da0
Author: Alessandro Decina <alessandro.d at gmail.com>
Date: Wed Jan 18 11:28:26 2012 +0100
mpegpsdemux: don't scan for the last PTS if the first wasn't found
---
gst/mpegdemux/gstmpegdemux.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c
index d1f58d0..ec9b613 100644
--- a/gst/mpegdemux/gstmpegdemux.c
+++ b/gst/mpegdemux/gstmpegdemux.c
@@ -2543,13 +2543,16 @@ gst_flups_sink_get_duration (GstFluPSDemux * demux)
" in packet starting at %" G_GUINT64_FORMAT,
demux->first_pts, GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (demux->first_pts)),
offset);
- /* scan for last PTS in the stream */
- offset = demux->sink_segment.stop;
- gst_flups_demux_scan_backward_ts (demux, &offset, SCAN_PTS, &demux->last_pts);
- GST_DEBUG_OBJECT (demux, "Last PTS: %" G_GINT64_FORMAT " %" GST_TIME_FORMAT
- " in packet starting at %" G_GUINT64_FORMAT,
- demux->last_pts, GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (demux->last_pts)),
- offset);
+ if (demux->first_pts != G_MAXUINT64) {
+ /* scan for last PTS in the stream */
+ offset = demux->sink_segment.stop;
+ gst_flups_demux_scan_backward_ts (demux, &offset, SCAN_PTS,
+ &demux->last_pts);
+ GST_DEBUG_OBJECT (demux,
+ "Last PTS: %" G_GINT64_FORMAT " %" GST_TIME_FORMAT
+ " in packet starting at %" G_GUINT64_FORMAT, demux->last_pts,
+ GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (demux->last_pts)), offset);
+ }
/* Detect wrong SCR values */
if (demux->first_scr > demux->last_scr) {
GST_DEBUG_OBJECT (demux, "Wrong SCR values detected, searching for "
More information about the gstreamer-commits
mailing list