diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2008-03-20 18:10:29 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-03-20 18:10:29 +0000 |
commit | 29d918352b94957160a9be04dac076f2aca2c5d7 (patch) | |
tree | fb2411b5436cfd69b5b5660f4f3ebc93a58fa8b5 /gst | |
parent | 1cb3f3903bf2daa5ddfee8b5eb0000a413391118 (diff) | |
download | gst-plugins-bad-29d918352b94957160a9be04dac076f2aca2c5d7.tar.gz gst-plugins-bad-29d918352b94957160a9be04dac076f2aca2c5d7.tar.bz2 gst-plugins-bad-29d918352b94957160a9be04dac076f2aca2c5d7.zip |
gst/selector/gstinputselector.c: Do g_object_notify() only when not holding the lock to get the property because othe...
Original commit message from CVS:
* gst/selector/gstinputselector.c:
(gst_input_selector_set_active_pad), (gst_input_selector_switch):
Do g_object_notify() only when not holding the lock to get the property
because otherwise we run into a deadlock with the deep-notify handlers
that are possibly installed.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/selector/gstinputselector.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gst/selector/gstinputselector.c b/gst/selector/gstinputselector.c index 4f169cf6..7c963ad8 100644 --- a/gst/selector/gstinputselector.c +++ b/gst/selector/gstinputselector.c @@ -877,8 +877,9 @@ gst_segment_set_start (GstSegment * segment, gint64 running_time) segment->start += duration; } -/* this function must be called with the SELECTOR_LOCK. */ -static void +/* this function must be called with the SELECTOR_LOCK. It returns TRUE when the + * active pad changed. */ +static gboolean gst_input_selector_set_active_pad (GstInputSelector * self, GstPad * pad, gint64 stop_time, gint64 start_time) { @@ -886,7 +887,7 @@ gst_input_selector_set_active_pad (GstInputSelector * self, GstPad **active_pad_p; if (pad == self->active_sinkpad) - return; + return FALSE; old = GST_SELECTOR_PAD_CAST (self->active_sinkpad); new = GST_SELECTOR_PAD_CAST (pad); @@ -925,7 +926,7 @@ gst_input_selector_set_active_pad (GstInputSelector * self, GST_DEBUG_OBJECT (self, "New active pad is %" GST_PTR_FORMAT, self->active_sinkpad); - g_object_notify (G_OBJECT (self), "active-pad"); + return TRUE; } static void @@ -1213,14 +1214,20 @@ static void gst_input_selector_switch (GstInputSelector * self, GstPad * pad, gint64 stop_time, gint64 start_time) { + gboolean changed; + g_return_if_fail (self->blocked == TRUE); GST_INPUT_SELECTOR_LOCK (self); - gst_input_selector_set_active_pad (self, pad, stop_time, start_time); + changed = + gst_input_selector_set_active_pad (self, pad, stop_time, start_time); self->blocked = FALSE; GST_INPUT_SELECTOR_BROADCAST (self); GST_INPUT_SELECTOR_UNLOCK (self); + + if (changed) + g_object_notify (G_OBJECT (self), "active-pad"); } static gboolean |