[gst-cvs] gstreamer: queue2: release queue2 lock before notify
Wim Taymans
wtay at kemper.freedesktop.org
Mon Oct 11 09:11:30 PDT 2010
Module: gstreamer
Branch: master
Commit: 62ffd66f109c5c17fa8b49a69a9a382ca5c76541
URL: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=62ffd66f109c5c17fa8b49a69a9a382ca5c76541
Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date: Mon Oct 11 18:10:07 2010 +0200
queue2: release queue2 lock before notify
Make sure that we don't hold the lock when we notify the temp-location
property,
Fixes #631853
---
plugins/elements/gstqueue2.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c
index ef58f23..2661460 100644
--- a/plugins/elements/gstqueue2.c
+++ b/plugins/elements/gstqueue2.c
@@ -1314,6 +1314,8 @@ gst_queue2_read_item_from_file (GstQueue2 * queue)
return item;
}
+/* must be called with MUTEX_LOCK. Will briefly release the lock when notifying
+ * the temp filename. */
static gboolean
gst_queue2_open_temp_location_file (GstQueue2 * queue)
{
@@ -1350,7 +1352,12 @@ gst_queue2_open_temp_location_file (GstQueue2 * queue)
g_free (queue->temp_location);
queue->temp_location = name;
+ GST_QUEUE2_MUTEX_UNLOCK (queue);
+
+ /* we can't emit the notify with the lock */
g_object_notify (G_OBJECT (queue), "temp-location");
+
+ GST_QUEUE2_MUTEX_LOCK (queue);
} else {
/* open the file for update/writing, this is deprecated but we still need to
* support it for API/ABI compatibility */
@@ -2712,6 +2719,7 @@ gst_queue2_src_activate_pull (GstPad * pad, gboolean active)
queue = GST_QUEUE2 (gst_pad_get_parent (pad));
if (active) {
+ GST_QUEUE2_MUTEX_LOCK (queue);
if (!QUEUE_IS_USING_QUEUE (queue)) {
if (QUEUE_IS_USING_TEMP_FILE (queue)) {
/* open the temp file now */
@@ -2723,7 +2731,6 @@ gst_queue2_src_activate_pull (GstPad * pad, gboolean active)
result = TRUE;
}
- GST_QUEUE2_MUTEX_LOCK (queue);
GST_DEBUG_OBJECT (queue, "activating pull mode");
init_ranges (queue);
queue->srcresult = GST_FLOW_OK;
More information about the Gstreamer-commits
mailing list