From 3b44a44a0147d81de82ace9d9d843deb1b1c1689 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 24 May 2013 18:30:44 +0200 Subject: [PATCH] multiqueue: Make sure to always signal any possible pending serialized queries And don't unref them when flushing the queue, they're owned by the caller! https://bugzilla.gnome.org/show_bug.cgi?id=700342 --- plugins/elements/gstmultiqueue.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index a7ae207..68892d3 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -728,9 +728,6 @@ gst_multi_queue_change_state (GstElement * element, GstStateChange transition) } return result; - - - } static gboolean @@ -1113,7 +1110,7 @@ gst_multi_queue_item_steal_object (GstMultiQueueItem * item) static void gst_multi_queue_item_destroy (GstMultiQueueItem * item) { - if (item->object) + if (item->object && !GST_IS_QUERY (item->object)) gst_mini_object_unref (item->object); g_slice_free (GstMultiQueueItem, item); } @@ -1362,6 +1359,8 @@ out_flushing: compute_high_time (mq); compute_high_id (mq); wake_up_next_non_linked (mq); + sq->last_query = FALSE; + g_cond_signal (&sq->query_handled); GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); /* upstream needs to see fatal result ASAP to shut things down, @@ -1462,8 +1461,12 @@ gst_multi_queue_sink_activate_mode (GstPad * pad, GstObject * parent, /* All pads start off linked until they push one buffer */ sq->srcresult = GST_FLOW_OK; sq->pushed = FALSE; + gst_data_queue_set_flushing (sq->queue, FALSE); } else { sq->srcresult = GST_FLOW_FLUSHING; + sq->last_query = FALSE; + g_cond_signal (&sq->query_handled); + gst_data_queue_set_flushing (sq->queue, TRUE); gst_data_queue_flush (sq->queue); } res = TRUE; -- 2.7.4