From bede14df3414b8ce69beedc87f126cd9d7d7684b Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 21 Apr 2002 14:16:36 +0000 Subject: [PATCH] give useful warning when not unique Original commit message from CVS: give useful warning when not unique --- gst/gstbin.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gst/gstbin.c b/gst/gstbin.c index 0f803468e7..9f1fd727ac 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -352,8 +352,13 @@ gst_bin_add (GstBin *bin, GstElement *element) g_return_if_fail (GST_ELEMENT_PARENT (element) == NULL); /* then check to see if the element's name is already taken in the bin */ - g_return_if_fail (gst_object_check_uniqueness (bin->children, GST_ELEMENT_NAME (element)) == - TRUE); + if (gst_object_check_uniqueness (bin->children, + GST_ELEMENT_NAME (element)) == FALSE) + { + g_warning ("Name %s is not unique in bin %s, not adding\n", + GST_ELEMENT_NAME (element), GST_ELEMENT_NAME (bin)); + return; + } /* set the element's parent and add the element to the bin's list of children */ gst_object_set_parent (GST_OBJECT (element), GST_OBJECT (bin));