mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
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.
This commit is contained in:
parent
9f3e48b55b
commit
38c07bac1d
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue