pulsesink: Flush the ringbuffer on GAP events without duration
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 24 Oct 2012 09:17:55 +0000 (11:17 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 24 Oct 2012 09:19:52 +0000 (11:19 +0200)
This is required to properly start the ringbuffer and clock.

ext/pulse/pulsesink.c

index 85c488a..249460e 100644 (file)
@@ -2812,6 +2812,14 @@ gst_pulsesink_event (GstBaseSink * sink, GstEvent * event)
 
       break;
     }
+    case GST_EVENT_GAP:{
+      GstClockTime timestamp, duration;
+
+      gst_event_parse_gap (event, &timestamp, &duration);
+      if (duration == GST_CLOCK_TIME_NONE)
+        gst_pulsesink_flush_ringbuffer (pulsesink);
+      break;
+    }
     case GST_EVENT_EOS:
       gst_pulsesink_flush_ringbuffer (pulsesink);
       break;