gst/avi/gstavidemux.c: Set EOS when going out of the segment in reverse playback
authorThijs Vermeir <thijsvermeir@gmail.com>
Wed, 4 Jun 2008 16:49:26 +0000 (16:49 +0000)
committerThijs Vermeir <thijsvermeir@gmail.com>
Wed, 4 Jun 2008 16:49:26 +0000 (16:49 +0000)
Original commit message from CVS:
* gst/avi/gstavidemux.c:
Set EOS when going out of the segment in reverse playback

ChangeLog
gst/avi/gstavidemux.c

index 11cb6dc..69511ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-04  Thijs Vermeir  <thijsvermeir@gmail.com>
+
+       * gst/avi/gstavidemux.c:
+       Set EOS when going out of the segment in reverse playback
+
 2008-06-04  Tim-Philipp Müller  <tim.muller at collabora co uk>
 
        * ext/taglib/Makefile.am::
index dd5aae7..e2a1504 100644 (file)
@@ -3461,11 +3461,14 @@ gst_avi_demux_process_next_entry (GstAviDemux * avi)
     /* check for reverse playback */
     if (avi->segment.rate < 0 && avi->current_entry > avi->reverse_stop_index) {
       GST_LOG_OBJECT (avi, "stop_index %d reached", avi->reverse_stop_index);
+
+      /* check if we have pushed enough data for this segment */
+      if (avi->reverse_start_index == 0)
+        goto eos_reverse_zero;
+      if (avi->index_entries[avi->reverse_start_index].ts < avi->segment.start)
+        goto eos_reverse_segment;
+
       avi->reverse_stop_index = avi->reverse_start_index;
-      if (avi->reverse_start_index == 0) {
-        GST_DEBUG_OBJECT (avi, "start_index was 0, sending eos");
-        goto eos;
-      }
       entry =
           gst_avi_demux_index_prev (avi, 0, avi->reverse_stop_index,
           GST_AVI_INDEX_ENTRY_FLAG_KEYFRAME);
@@ -3597,6 +3600,18 @@ eos_stop:
     res = GST_FLOW_UNEXPECTED;
     goto beach;
   }
+eos_reverse_zero:
+  {
+    GST_DEBUG_OBJECT (avi, "start_index was 0, setting EOS");
+    res = GST_FLOW_UNEXPECTED;
+    goto beach;
+  }
+eos_reverse_segment:
+  {
+    GST_DEBUG_OBJECT (avi, "full segment pushed, setting EOS");
+    res = GST_FLOW_UNEXPECTED;
+    goto beach;
+  }
 pull_failed:
   {
     GST_DEBUG_OBJECT (avi,