summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKipp Cannon <kcannon@ligo.caltech.edu>2010-01-24 20:55:26 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-01-24 20:55:26 +0100
commita37426c41c80fd21e5017fea01a786c05bcd9661 (patch)
treef25bf0d622e29aa79af492d5468a637876856e3e
parent1ae783dafc90c554961d819aedf91baa9d207d87 (diff)
inputselector: Protect g_object_notify() with the object's mutex
This works around the thread unsafety of g_object_notify() Fixes bug #607513.
-rw-r--r--gst/playback/gstinputselector.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gst/playback/gstinputselector.c b/gst/playback/gstinputselector.c
index 72aa9ffc..53a38229 100644
--- a/gst/playback/gstinputselector.c
+++ b/gst/playback/gstinputselector.c
@@ -357,10 +357,10 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event)
* is enabled */
if (pad != active_sinkpad && !sel->select_all)
forward = FALSE;
- GST_INPUT_SELECTOR_UNLOCK (sel);
if (prev_active_sinkpad != active_sinkpad && pad == active_sinkpad)
g_object_notify (G_OBJECT (sel), "active-pad");
+ GST_INPUT_SELECTOR_UNLOCK (sel);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START:
@@ -422,7 +422,9 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event)
GST_DEBUG_OBJECT (pad, "received tags %" GST_PTR_FORMAT, newtags);
GST_OBJECT_UNLOCK (selpad);
+ GST_INPUT_SELECTOR_LOCK (sel);
g_object_notify (G_OBJECT (selpad), "tags");
+ GST_INPUT_SELECTOR_UNLOCK (sel);
break;
}
case GST_EVENT_EOS:
@@ -502,11 +504,11 @@ gst_selector_pad_bufferalloc (GstPad * pad, guint64 offset,
if (pad != active_sinkpad)
goto not_active;
- GST_INPUT_SELECTOR_UNLOCK (sel);
-
if (prev_active_sinkpad != active_sinkpad && pad == active_sinkpad)
g_object_notify (G_OBJECT (sel), "active-pad");
+ GST_INPUT_SELECTOR_UNLOCK (sel);
+
result = gst_pad_alloc_buffer (sel->srcpad, offset, size, caps, buf);
done:
@@ -624,10 +626,10 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
selpad->segment_pending = FALSE;
}
- GST_INPUT_SELECTOR_UNLOCK (sel);
if (prev_active_sinkpad != active_sinkpad && pad == active_sinkpad)
g_object_notify (G_OBJECT (sel), "active-pad");
+ GST_INPUT_SELECTOR_UNLOCK (sel);
if (close_event)
gst_pad_push_event (sel->srcpad, close_event);
@@ -1411,10 +1413,10 @@ gst_input_selector_switch (GstInputSelector * self, GstPad * pad,
self->blocked = FALSE;
GST_INPUT_SELECTOR_BROADCAST (self);
- GST_INPUT_SELECTOR_UNLOCK (self);
if (changed)
g_object_notify (G_OBJECT (self), "active-pad");
+ GST_INPUT_SELECTOR_UNLOCK (self);
}
static gboolean