hlsdemux: Send flush start event before waiting for the tasks to finish
authorSebastian Dröge <sebastian@centricular.com>
Wed, 26 Mar 2014 06:22:54 +0000 (07:22 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 29 Mar 2014 09:33:45 +0000 (10:33 +0100)
Otherwise we'll wait until buffers are completely processed downstream,
which might take quite some time.

ext/hls/gsthlsdemux.c

index 2ce7c27..eab3657 100644 (file)
@@ -366,6 +366,11 @@ gst_hls_demux_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
           " stop: %" GST_TIME_FORMAT, rate, GST_TIME_ARGS (start),
           GST_TIME_ARGS (stop));
 
+      if (flags & GST_SEEK_FLAG_FLUSH) {
+        GST_DEBUG_OBJECT (demux, "sending flush start");
+        gst_pad_push_event (demux->srcpad, gst_event_new_flush_start ());
+      }
+
       gst_hls_demux_pause_tasks (demux);
 
       /* wait for streaming to finish */
@@ -433,11 +438,6 @@ gst_hls_demux_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
         current_sequence++;
       }
 
-      if (flags & GST_SEEK_FLAG_FLUSH) {
-        GST_DEBUG_OBJECT (demux, "sending flush start");
-        gst_pad_push_event (demux->srcpad, gst_event_new_flush_start ());
-      }
-
       GST_M3U8_CLIENT_LOCK (demux->client);
       GST_DEBUG_OBJECT (demux, "seeking to sequence %u",
           (guint) current_sequence);