From a794d8cccf554a3010419719473ad3948b85ee1a Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 20 Oct 2008 14:19:17 +0000 Subject: gst/mpegdemux/gstmpegdemux.c: Fix reverse playback regression. Original commit message from CVS: * gst/mpegdemux/gstmpegdemux.c: (gst_flups_demux_send_data): Fix reverse playback regression. Fixes #557080 --- ChangeLog | 6 ++++++ gst/mpegdemux/gstmpegdemux.c | 20 ++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43cbaa06..28aeec30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-10-20 Edward Hervey + + * gst/mpegdemux/gstmpegdemux.c: (gst_flups_demux_send_data): + Fix reverse playback regression. + Fixes #557080 + 2008-10-19 Tim-Philipp Müller * ext/apexsink/gstapexplugin.c: (plugin_init): diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c index 2b8168ae..e4f13839 100644 --- a/gst/mpegdemux/gstmpegdemux.c +++ b/gst/mpegdemux/gstmpegdemux.c @@ -453,21 +453,33 @@ gst_flups_demux_send_data (GstFluPSDemux * demux, GstFluPSStream * stream, gint64 time, start, stop; GstEvent *newsegment; + GST_DEBUG ("timestamp:%" GST_TIME_FORMAT " base_time %" GST_TIME_FORMAT + " src_segment.start:%" GST_TIME_FORMAT " .stop:%" GST_TIME_FORMAT, + GST_TIME_ARGS (timestamp), GST_TIME_ARGS (demux->base_time), + GST_TIME_ARGS (demux->src_segment.start), + GST_TIME_ARGS (demux->src_segment.stop)); + if (GST_CLOCK_TIME_IS_VALID (demux->base_time) && GST_CLOCK_TIME_IS_VALID (demux->src_segment.start)) start = demux->base_time + demux->src_segment.start; else start = 0; - if (timestamp != GST_CLOCK_TIME_NONE && - GST_CLOCK_DIFF (start, timestamp) > GST_SECOND) - start = timestamp; - if (GST_CLOCK_TIME_IS_VALID (demux->src_segment.stop) && GST_CLOCK_TIME_IS_VALID (demux->base_time)) stop = demux->base_time + demux->src_segment.stop; else stop = -1; + + if (timestamp != GST_CLOCK_TIME_NONE) { + if (demux->src_segment.rate > 0) { + if (GST_CLOCK_DIFF (start, timestamp) > GST_SECOND) + start = timestamp; + } else { + if (GST_CLOCK_DIFF (stop, timestamp) > GST_SECOND) + stop = timestamp; + } + } time = start; #ifdef HAVE_NEWSEG_FULL -- cgit v1.2.1