funnel: Make sure to only lock the stream lock once
authorSebastian Dröge <sebastian@centricular.com>
Wed, 9 Nov 2016 09:37:09 +0000 (11:37 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 9 Nov 2016 09:37:09 +0000 (11:37 +0200)
We also only unlock it once, and otherwise have it locked forever from
this thread, causing deadlocks on shutdown later.

plugins/elements/gstfunnel.c

index 894d00f..3597d58 100644 (file)
@@ -403,8 +403,10 @@ gst_funnel_sink_event (GstPad * pad, GstObject * parent, GstEvent * 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. */
-    unlock = TRUE;
-    GST_PAD_STREAM_LOCK (funnel->srcpad);
+    if (!unlock) {
+      unlock = TRUE;
+      GST_PAD_STREAM_LOCK (funnel->srcpad);
+    }
 
     if ((funnel->last_sinkpad == NULL) || (funnel->forward_sticky_events
             && (funnel->last_sinkpad != pad))) {