container: return TRUE if adding doesn't cause any errors

If `add_child` and `set_parent` succeed we want to return TRUE, even if
the added element is no longer a child by the end of the method. This is
because some users may call ges_container_remove during `child-added`.
This shouldn't be considered an error.
This commit is contained in:
Henry Wilkes 2020-05-01 14:26:32 +01:00
parent 7dd6bc4de2
commit 00a9825ffb

View file

@ -847,6 +847,8 @@ ges_container_add (GESContainer * container, GESTimelineElement * child)
child);
priv->adding_children = g_list_remove (priv->adding_children, child);
ret = TRUE;
done:
/* thaw all notifies */
/* Ignore notifies for the start and duration since the child should
@ -857,7 +859,6 @@ done:
g_object_thaw_notify (G_OBJECT (tmp->data));
g_object_thaw_notify (G_OBJECT (child));
g_list_free_full (current_children, gst_object_unref);
ret = ! !g_list_find (container->children, child);
gst_object_unref (child);
container->children_control_mode = GES_CHILDREN_UPDATE;
return ret;