utils: defer getting the classes until we actualy need them

This function has a lot of early returns. Give them soem more benefit.
This commit is contained in:
Stefan Kost 2010-01-10 21:49:25 +02:00
parent 5fa9d942e3
commit 3c09381cef

View file

@ -1579,9 +1579,6 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname,
g_return_val_if_fail (GST_IS_ELEMENT (src), FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (dest), FALSE);
srcclass = GST_ELEMENT_GET_CLASS (src);
destclass = GST_ELEMENT_GET_CLASS (dest);
GST_CAT_INFO (GST_CAT_ELEMENT_PADS,
"trying to link element %s:%s to element %s:%s", GST_ELEMENT_NAME (src),
srcpadname ? srcpadname : "(any)", GST_ELEMENT_NAME (dest),
@ -1764,6 +1761,9 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname,
destpad = NULL;
}
srcclass = GST_ELEMENT_GET_CLASS (src);
destclass = GST_ELEMENT_GET_CLASS (dest);
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS,
"we might have request pads on both sides, checking...");
srctempls = gst_element_class_get_pad_template_list (srcclass);