mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
bin: element: Ignore activate result for removed pads on state change
This fixes a race where a state change may return failure if it has request pads that are deactivated and removed (and thus have no parent) at the same time as the element changes state and (de)activates its pads. https://bugzilla.gnome.org/show_bug.cgi?id=755342
This commit is contained in:
parent
64a152439c
commit
0fbf1d3eb7
2 changed files with 16 additions and 6 deletions
11
gst/gstbin.c
11
gst/gstbin.c
|
@ -2371,15 +2371,20 @@ was_busy:
|
|||
}
|
||||
|
||||
/* gst_iterator_fold functions for pads_activate
|
||||
* Stop the iterator if activating one pad failed. */
|
||||
* Stop the iterator if activating one pad failed, but only if that pad
|
||||
* has not been removed from the element. */
|
||||
static gboolean
|
||||
activate_pads (const GValue * vpad, GValue * ret, gboolean * active)
|
||||
{
|
||||
GstPad *pad = g_value_get_object (vpad);
|
||||
gboolean cont = TRUE;
|
||||
|
||||
if (!(cont = gst_pad_set_active (pad, *active)))
|
||||
g_value_set_boolean (ret, FALSE);
|
||||
if (!gst_pad_set_active (pad, *active)) {
|
||||
if (GST_PAD_PARENT (pad) != NULL) {
|
||||
cont = FALSE;
|
||||
g_value_set_boolean (ret, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
return cont;
|
||||
}
|
||||
|
|
|
@ -2679,15 +2679,20 @@ invalid_return:
|
|||
}
|
||||
|
||||
/* gst_iterator_fold functions for pads_activate
|
||||
* Stop the iterator if activating one pad failed. */
|
||||
* Stop the iterator if activating one pad failed, but only if that pad
|
||||
* has not been removed from the element. */
|
||||
static gboolean
|
||||
activate_pads (const GValue * vpad, GValue * ret, gboolean * active)
|
||||
{
|
||||
GstPad *pad = g_value_get_object (vpad);
|
||||
gboolean cont = TRUE;
|
||||
|
||||
if (!(cont = gst_pad_set_active (pad, *active)))
|
||||
g_value_set_boolean (ret, FALSE);
|
||||
if (!gst_pad_set_active (pad, *active)) {
|
||||
if (GST_PAD_PARENT (pad) != NULL) {
|
||||
cont = FALSE;
|
||||
g_value_set_boolean (ret, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
return cont;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue