From: Mark Nauwelaerts Date: Tue, 10 May 2011 09:11:15 +0000 (+0200) Subject: multiqueue: ensure thread safety when adding a pad X-Git-Tag: RELEASE-0.10.34~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24888ecc704599f4d0f6e632869b73214482d599;p=platform%2Fupstream%2Fgstreamer.git multiqueue: ensure thread safety when adding a pad This seems to be a regression, and was causing crashes. https://bugzilla.gnome.org/show_bug.cgi?id=649878 --- diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 3988c56..b6b2d24 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -1755,8 +1755,6 @@ gst_single_queue_new (GstMultiQueue * mqueue, gint id) sq->extra_size.bytes = mqueue->extra_size.bytes; sq->extra_size.time = mqueue->extra_size.time; - GST_MULTI_QUEUE_MUTEX_UNLOCK (mqueue); - GST_DEBUG_OBJECT (mqueue, "Creating GstSingleQueue id:%d", sq->id); sq->mqueue = mqueue; @@ -1818,6 +1816,8 @@ gst_single_queue_new (GstMultiQueue * mqueue, gint id) gst_pad_set_element_private (sq->sinkpad, (gpointer) sq); gst_pad_set_element_private (sq->srcpad, (gpointer) sq); + GST_MULTI_QUEUE_MUTEX_UNLOCK (mqueue); + /* only activate the pads when we are not in the NULL state * and add the pad under the state_lock to prevend state changes * between activating and adding */