avidemux: reset some more stream state after seek
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Tue, 16 Feb 2010 14:00:13 +0000 (15:00 +0100)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Tue, 16 Feb 2010 14:03:59 +0000 (15:03 +0100)
In particular, fixes non-flushing seek.

gst/avi/gstavidemux.c

index b87ee6c..e8e1c08 100644 (file)
@@ -4047,13 +4047,6 @@ gst_avi_demux_handle_seek (GstAviDemux * avi, GstPad * pad, GstEvent * event)
     GST_DEBUG_OBJECT (avi, "sending flush stop");
     gst_avi_demux_push_event (avi, gst_event_ref (fevent));
     gst_pad_push_event (avi->sinkpad, fevent);
-
-    /* reset the last flow and mark discont, FLUSH is always DISCONT */
-    for (i = 0; i < avi->num_streams; i++) {
-      GST_DEBUG_OBJECT (avi, "marking DISCONT");
-      avi->stream[i].last_flow = GST_FLOW_OK;
-      avi->stream[i].discont = TRUE;
-    }
   } else if (avi->segment_running) {
     GstEvent *seg;
 
@@ -4101,6 +4094,12 @@ gst_avi_demux_handle_seek (GstAviDemux * avi, GstPad * pad, GstEvent * event)
     gst_pad_start_task (avi->sinkpad, (GstTaskFunction) gst_avi_demux_loop,
         avi->sinkpad);
   }
+  /* reset the last flow and mark discont, seek is always DISCONT */
+  for (i = 0; i < avi->num_streams; i++) {
+    GST_DEBUG_OBJECT (avi, "marking DISCONT");
+    avi->stream[i].last_flow = GST_FLOW_OK;
+    avi->stream[i].discont = TRUE;
+  }
   GST_PAD_STREAM_UNLOCK (avi->sinkpad);
 
   return TRUE;