summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@collabora.com>2013-06-26 17:25:37 -0400
committerThibault Saunier <thibault.saunier@collabora.com>2013-06-26 17:25:37 -0400
commite6fc28ff47180df95f48a763416a65e4ae2c0a55 (patch)
tree391dabdd2e693c948875a1d0a93f64488e2fc436
parent5c026dfe236c6d6493e77c3eaafa643bb0dfd7ff (diff)
composition: Add entry to the the hashtable before connecting to pad-added
Avoiding races where the pad would be added right between the connection and inserting to the hashtable
-rw-r--r--gnl/gnlcomposition.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gnl/gnlcomposition.c b/gnl/gnlcomposition.c
index d2258da..fe2c0cc 100644
--- a/gnl/gnlcomposition.c
+++ b/gnl/gnlcomposition.c
@@ -2848,14 +2848,14 @@ gnl_composition_add_object (GstBin * bin, GstElement * element)
gnl_object_commit (GNL_OBJECT (element), FALSE);
}
+ /* ...and add it to the hash table */
+ g_hash_table_insert (priv->objects_hash, element, entry);
+
entry->padremovedhandler = g_signal_connect (G_OBJECT (element),
"pad-removed", G_CALLBACK (object_pad_removed), comp);
entry->padaddedhandler = g_signal_connect (G_OBJECT (element),
"pad-added", G_CALLBACK (object_pad_added), comp);
- /* ...and add it to the hash table */
- g_hash_table_insert (priv->objects_hash, element, entry);
-
/* Set the caps of the composition */
if (G_UNLIKELY (!gst_caps_is_any (((GnlObject *) comp)->caps)))
gnl_object_set_caps ((GnlObject *) element, ((GnlObject *) comp)->caps);