asfdemux: Only send flush event on seeking flushes
authorEdward Hervey <edward@centricular.com>
Fri, 11 May 2018 07:21:09 +0000 (09:21 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Tue, 22 May 2018 04:52:58 +0000 (06:52 +0200)
And not on all the time

gst/asfdemux/gstasfdemux.c

index 80c4fa757fdf553c3ac60aaa01a8e5fe3bd69f95..795c82fa4a766047bfc417dd6cb8a3b6fbcddb49 100644 (file)
@@ -732,15 +732,13 @@ gst_asf_demux_handle_seek_event (GstASFDemux * demux, GstEvent * event)
    * forever */
   GST_PAD_STREAM_LOCK (demux->sinkpad);
 
-  /* we now can stop flushing, since we have the stream lock now */
-  fevent = gst_event_new_flush_stop (TRUE);
-  gst_event_set_seqnum (fevent, seqnum);
-  gst_pad_push_event (demux->sinkpad, gst_event_ref (fevent));
-
-  if (G_LIKELY (flush))
+  if (G_LIKELY (flush)) {
+    /* we now can stop flushing, since we have the stream lock now */
+    fevent = gst_event_new_flush_stop (TRUE);
+    gst_event_set_seqnum (fevent, seqnum);
+    gst_pad_push_event (demux->sinkpad, gst_event_ref (fevent));
     gst_asf_demux_send_event_unlocked (demux, fevent);
-  else
-    gst_event_unref (fevent);
+  }
 
   /* operating on copy of segment until we know the seek worked */
   segment = demux->segment;