gst/mpegdemux/gstmpegdemux.c: Fix reverse playback regression.
authorEdward Hervey <bilboed@bilboed.com>
Mon, 20 Oct 2008 14:19:17 +0000 (14:19 +0000)
committerEdward Hervey <bilboed@bilboed.com>
Mon, 20 Oct 2008 14:19:17 +0000 (14:19 +0000)
Original commit message from CVS:
* gst/mpegdemux/gstmpegdemux.c: (gst_flups_demux_send_data):
Fix reverse playback regression.
Fixes #557080

ChangeLog
gst/mpegdemux/gstmpegdemux.c

index 43cbaa0..28aeec3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-20  Edward Hervey  <edward.hervey@collabora.co.uk>
+
+       * gst/mpegdemux/gstmpegdemux.c: (gst_flups_demux_send_data):
+       Fix reverse playback regression.
+       Fixes #557080
+
 2008-10-19  Tim-Philipp Müller  <tim.muller at collabora co uk>
 
        * ext/apexsink/gstapexplugin.c: (plugin_init):
index 2b8168a..e4f1383 100644 (file)
@@ -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