mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
element: If activating one pad failed error out early instead of trying to activate the next pads
If one pad fails to activate the complete activation process will fail anyway and trying to activate the other pads only wastes time.
This commit is contained in:
parent
f3f1f7d69a
commit
2f947f3993
1 changed files with 6 additions and 7 deletions
|
@ -2793,18 +2793,18 @@ invalid_return:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* gst_iterator_fold functions for pads_activate
|
/* gst_iterator_fold functions for pads_activate
|
||||||
* Note how we don't stop the iterator when we fail an activation. This is
|
* Stop the iterator if activating one pad failed. */
|
||||||
* probably a FIXME since when one pad activation fails, we don't want to
|
|
||||||
* continue our state change. */
|
|
||||||
static gboolean
|
static gboolean
|
||||||
activate_pads (GstPad * pad, GValue * ret, gboolean * active)
|
activate_pads (GstPad * pad, GValue * ret, gboolean * active)
|
||||||
{
|
{
|
||||||
if (!gst_pad_set_active (pad, *active))
|
gboolean cont = TRUE;
|
||||||
|
|
||||||
|
if (!(cont = gst_pad_set_active (pad, *active)))
|
||||||
g_value_set_boolean (ret, FALSE);
|
g_value_set_boolean (ret, FALSE);
|
||||||
|
|
||||||
/* unref the object that was reffed for us by _fold */
|
/* unref the object that was reffed for us by _fold */
|
||||||
gst_object_unref (pad);
|
gst_object_unref (pad);
|
||||||
return TRUE;
|
return cont;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the caps on the pad to NULL */
|
/* set the caps on the pad to NULL */
|
||||||
|
@ -2816,8 +2816,7 @@ clear_caps (GstPad * pad, GValue * ret, gboolean * active)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns false on error or early cutout (will never happen because the fold
|
/* returns false on error or early cutout of the fold, true if all
|
||||||
* function always returns TRUE, see FIXME above) of the fold, true if all
|
|
||||||
* pads in @iter were (de)activated successfully. */
|
* pads in @iter were (de)activated successfully. */
|
||||||
static gboolean
|
static gboolean
|
||||||
iterator_activate_fold_with_resync (GstIterator * iter,
|
iterator_activate_fold_with_resync (GstIterator * iter,
|
||||||
|
|
Loading…
Reference in a new issue