qtdemux: remember reverse playback when verifying the segment end
authorThiago Santos <ts.santos@sisa.samsung.com>
Tue, 7 Jan 2014 00:36:17 +0000 (21:36 -0300)
committerThiago Santos <ts.santos@sisa.samsung.com>
Wed, 15 Jan 2014 18:33:45 +0000 (15:33 -0300)
Check if the rate is positive or negative to correctly compare the current
position with the segment to make reverse playback work

gst/isomp4/qtdemux.c

index b0c5cd2..5f2e11c 100644 (file)
@@ -4223,7 +4223,9 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux)
 
   /* check for segment end */
   if (G_UNLIKELY (qtdemux->segment.stop != -1
-          && qtdemux->segment.stop <= min_time
+          && ((qtdemux->segment.rate >= 0 && qtdemux->segment.stop <= min_time)
+              || (qtdemux->segment.rate < 0
+                  && qtdemux->segment.start > min_time))
           && qtdemux->streams[index]->on_keyframe)) {
     GST_DEBUG_OBJECT (qtdemux, "we reached the end of our segment.");
     qtdemux->streams[index]->time_position = -1;