From 38c07bac1dbeab510de1a89439a7b7123b2f5496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 1 Apr 2011 13:56:09 +0200 Subject: [PATCH] element: When requesting an existing pad print a g_critical() instead of using an assertion Some applications are requesting the same pad name multiple times and the behaviour is undefined and different from element to element but we don't want to break applications that work just fine. In 0.11 this check should be an assertion again, although elements have to do manual checking if the pad already exists again because it can't be done in a threadsafe way here. --- gst/gstelement.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/gstelement.c b/gst/gstelement.c index 1b37cfd574..3133da5756 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1021,9 +1021,13 @@ _gst_element_request_pad (GstElement * element, GstPadTemplate * templ, } pad = gst_element_get_static_pad (element, name); - if (pad) + if (pad) { gst_object_unref (pad); - g_return_val_if_fail (pad == NULL, NULL); + /* FIXME 0.11: Change this to g_return_val_if_fail() */ + g_critical ("Element %s already has a pad named %s, the behaviour of " + " gst_element_get_request_pad() for existing pads is undefined!", + GST_ELEMENT_NAME (element), name); + } } #endif