From 7d0015b973b689cfda027b2d65cf028b617cffa3 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Thu, 19 Mar 2015 09:32:25 +0100 Subject: ges: Fix build for older GLib The return type of g_hash_table_insert changed from void to boolean --- ges/ges-timeline-element.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'ges') diff --git a/ges/ges-timeline-element.c b/ges/ges-timeline-element.c index 0ddd28d9..742d9da1 100644 --- a/ges/ges-timeline-element.c +++ b/ges/ges-timeline-element.c @@ -1197,21 +1197,26 @@ gboolean ges_timeline_element_add_child_property (GESTimelineElement * self, GParamSpec * pspec, GObject * child) { + gchar *signame = g_strconcat ("notify::", pspec->name, NULL); + + if (g_hash_table_contains (self->priv->children_props, pspec)) { + GST_INFO_OBJECT (self, "Child property already exists: %s", pspec->name); + + return FALSE; + } + GST_DEBUG_OBJECT (self, "Adding child property: %" GST_PTR_FORMAT "::%s", child, pspec->name); - if (g_hash_table_insert (self->priv->children_props, - g_param_spec_ref (pspec), gst_object_ref (child))) { - gchar *signame = g_strconcat ("notify::", pspec->name, NULL); + g_hash_table_insert (self->priv->children_props, + g_param_spec_ref (pspec), gst_object_ref (child)); + signame = g_strconcat ("notify::", pspec->name, NULL); - g_signal_connect (child, signame, G_CALLBACK (child_prop_changed_cb), self); + g_signal_connect (child, signame, G_CALLBACK (child_prop_changed_cb), self); - g_free (signame); + g_free (signame); - return TRUE; - } - - return FALSE; + return TRUE; } /** -- cgit v1.2.3