mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 22:06:41 +00:00
composition: Avoid looping using gotos
This commit is contained in:
parent
03b11d58e4
commit
924f9ecf83
1 changed files with 2 additions and 7 deletions
|
@ -1831,26 +1831,21 @@ gnl_composition_change_state (GstElement * element, GstStateChange transition)
|
||||||
|
|
||||||
children = gst_bin_iterate_elements (GST_BIN (comp));
|
children = gst_bin_iterate_elements (GST_BIN (comp));
|
||||||
|
|
||||||
retry_lock:
|
while (G_UNLIKELY (gst_iterator_fold (children,
|
||||||
if (G_UNLIKELY (gst_iterator_fold (children,
|
|
||||||
(GstIteratorFoldFunction) lock_child_state, NULL,
|
(GstIteratorFoldFunction) lock_child_state, NULL,
|
||||||
NULL) == GST_ITERATOR_RESYNC)) {
|
NULL) == GST_ITERATOR_RESYNC)) {
|
||||||
gst_iterator_resync (children);
|
gst_iterator_resync (children);
|
||||||
goto retry_lock;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_iterator_free (children);
|
gst_iterator_free (children);
|
||||||
|
|
||||||
/* Set caps on all objects */
|
/* Set caps on all objects */
|
||||||
if (G_UNLIKELY (!gst_caps_is_any (GNL_OBJECT (comp)->caps))) {
|
if (G_UNLIKELY (!gst_caps_is_any (GNL_OBJECT (comp)->caps))) {
|
||||||
children = gst_bin_iterate_elements (GST_BIN (comp));
|
children = gst_bin_iterate_elements (GST_BIN (comp));
|
||||||
|
|
||||||
retry_caps:
|
while (G_UNLIKELY (gst_iterator_fold (children,
|
||||||
if (G_UNLIKELY (gst_iterator_fold (children,
|
|
||||||
(GstIteratorFoldFunction) set_child_caps, NULL,
|
(GstIteratorFoldFunction) set_child_caps, NULL,
|
||||||
comp) == GST_ITERATOR_RESYNC)) {
|
comp) == GST_ITERATOR_RESYNC)) {
|
||||||
gst_iterator_resync (children);
|
gst_iterator_resync (children);
|
||||||
goto retry_caps;
|
|
||||||
}
|
}
|
||||||
gst_iterator_free (children);
|
gst_iterator_free (children);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue