Port gtk-doc comments to their equivalent markdown syntax
[platform/upstream/gstreamer.git] / plugins / elements / gstfunnel.c
index 9895b7b..a929338 100644 (file)
@@ -24,6 +24,7 @@
 
 /**
  * SECTION:element-funnel
+ * @title: funnel
  *
  * Takes packets from various input sinks into one output source.
  *
@@ -397,15 +398,23 @@ gst_funnel_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
     GST_OBJECT_LOCK (funnel);
     fpad->got_eos = FALSE;
     GST_OBJECT_UNLOCK (funnel);
-  } else if (GST_EVENT_TYPE (event) == GST_EVENT_GAP) {
-    /* If no data is coming and we receive GAP event, need to forward sticky events. */
-    unlock = TRUE;
-    GST_PAD_STREAM_LOCK (funnel->srcpad);
-    GST_OBJECT_LOCK (funnel);
-    gst_object_replace ((GstObject **) & funnel->last_sinkpad,
-        GST_OBJECT (pad));
-    GST_OBJECT_UNLOCK (funnel);
-    gst_pad_sticky_events_foreach (pad, forward_events, funnel->srcpad);
+  }
+
+  if (forward && GST_EVENT_IS_SERIALIZED (event)) {
+    /* If no data is coming and we receive serialized event, need to forward all sticky events.
+     * Otherwise downstream has an inconsistent set of sticky events when
+     * handling the new event. */
+    if (!unlock) {
+      unlock = TRUE;
+      GST_PAD_STREAM_LOCK (funnel->srcpad);
+    }
+
+    if ((funnel->last_sinkpad == NULL) || (funnel->forward_sticky_events
+            && (funnel->last_sinkpad != pad))) {
+      gst_object_replace ((GstObject **) & funnel->last_sinkpad,
+          GST_OBJECT (pad));
+      gst_pad_sticky_events_foreach (pad, forward_events, funnel->srcpad);
+    }
   }
 
   if (forward)