nlecomposition: Do not fail when removing/adding child without commiting
authorThibault Saunier <tsaunier@gnome.org>
Mon, 12 Jan 2015 12:05:30 +0000 (13:05 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Wed, 20 May 2015 07:53:19 +0000 (09:53 +0200)
Summary:
We use to end up removing the nleobject when the following case happened:

 * add an object
 * remove that object
 * re add the object
 * commit the composition

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D193

ges/nle/nlecomposition.c

index 2e0eef9..c88a721 100644 (file)
@@ -696,6 +696,14 @@ _add_object_func (NleComposition * comp, ChildIOData * childio)
   in_pending_io = g_hash_table_lookup (priv->pending_io, object);
 
   if (g_hash_table_contains (priv->objects_hash, object)) {
+
+    if (in_pending_io) {
+      GST_INFO_OBJECT (comp, "Object already in but marked in pendings"
+          " removing from pendings");
+      g_hash_table_remove (priv->pending_io, object);
+
+      return;
+    }
     GST_ERROR_OBJECT (comp, "Object %" GST_PTR_FORMAT " is "
         " already in the composition", object);