From 2da56de19f1f8edadd52596483ca4182b0008d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 26 Oct 2014 11:04:38 +0100 Subject: [PATCH] Revert "decodebin: Fix locking" This reverts commit aa94d5dc9aa6ef381da6b60a67f218117c662958. --- gst/playback/gstdecodebin2.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 362c78ae94..bcc4db828a 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -2122,16 +2122,12 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad, if (pelem && gst_element_get_factory (pelem->element) == factory) skip = TRUE; } + CHAIN_MUTEX_UNLOCK (chain); - if (skip) { - GST_DEBUG_OBJECT (dbin, - "Skipping factory '%s' because it was already used in this chain", - gst_plugin_feature_get_name (GST_PLUGIN_FEATURE_CAST (factory))); - CHAIN_MUTEX_UNLOCK (chain); - continue; - } else if (chain->elements) { + if (!skip && chain->elements) { GstElementFactory *chainelemfact; + CHAIN_MUTEX_LOCK (chain); delem = (GstDecodeElement *) chain->elements->data; chainelemfact = gst_element_get_factory (delem->element); @@ -2146,9 +2142,15 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad, CHAIN_MUTEX_UNLOCK (chain); continue; } + CHAIN_MUTEX_UNLOCK (chain); + } + if (skip) { + GST_DEBUG_OBJECT (dbin, + "Skipping factory '%s' because it was already used in this chain", + gst_plugin_feature_get_name (GST_PLUGIN_FEATURE_CAST (factory))); + continue; } - CHAIN_MUTEX_UNLOCK (chain); } /* emit autoplug-select to see what we should do with it. */