From 60f4a78b3d42b48b91581fde7d6212c988915aba Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 13 Apr 2007 11:20:48 +0000 Subject: [PATCH] plugins/elements/gstmultiqueue.c: Don't deadlock when releasing a pad - gst_pad_set_active may try and take the multi... Original commit message from CVS: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_release_pad): Don't deadlock when releasing a pad - gst_pad_set_active may try and take the multiqueue lock too. --- ChangeLog | 6 ++++++ plugins/elements/gstmultiqueue.c | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 361e0f8..fe287fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-13 Jan Schmidt + + * plugins/elements/gstmultiqueue.c: (gst_multi_queue_release_pad): + Don't deadlock when releasing a pad - gst_pad_set_active may try + and take the multiqueue lock too. + 2007-04-12 Tim-Philipp Müller * gst/gsterror.c: (_gst_core_errors_init): diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 4bdaae2..3aca642 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -399,12 +399,19 @@ gst_multi_queue_release_pad (GstElement * element, GstPad * pad) if (!tmp) { GST_WARNING_OBJECT (mqueue, "That pad doesn't belong to this element ???"); + GST_MULTI_QUEUE_MUTEX_UNLOCK (mqueue); return; } + /* FIXME: The removal of the singlequeue should probably not happen until it + * finishes draining */ + /* remove it from the list */ mqueue->queues = g_list_delete_link (mqueue->queues, tmp); + /* FIXME : recompute next-non-linked */ + GST_MULTI_QUEUE_MUTEX_UNLOCK (mqueue); + /* delete SingleQueue */ gst_data_queue_set_flushing (sq->queue, TRUE); @@ -413,9 +420,6 @@ gst_multi_queue_release_pad (GstElement * element, GstPad * pad) gst_element_remove_pad (element, sq->srcpad); gst_element_remove_pad (element, sq->sinkpad); gst_single_queue_free (sq); - - /* FIXME : recompute next-non-linked */ - GST_MULTI_QUEUE_MUTEX_UNLOCK (mqueue); } static gboolean -- 2.7.4