audiorate: Fill gap events
authorMatej Knopp <matej.knopp@gmail.com>
Tue, 9 Dec 2014 02:18:37 +0000 (03:18 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Sun, 14 Dec 2014 11:09:12 +0000 (12:09 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=741281

gst/audiorate/gstaudiorate.c

index 9ac5beb..783ff35 100644 (file)
@@ -337,10 +337,19 @@ gst_audio_rate_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
       res = gst_pad_push_event (audiorate->srcpad, event);
       break;
     case GST_EVENT_GAP:
-      /* no gaps after audiorate, ignore the event */
+    {
+      /* Fill until end of gap */
+      GstClockTime timestamp, duration;
+      gst_event_parse_gap (event, &timestamp, &duration);
       gst_event_unref (event);
+      if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
+        if (GST_CLOCK_TIME_IS_VALID (duration))
+          timestamp += duration;
+        gst_audio_rate_fill_to_time (audiorate, timestamp);
+      }
       res = TRUE;
       break;
+    }
     default:
       res = gst_pad_event_default (pad, parent, event);
       break;