From: Stefan Kost Date: Sun, 10 Jan 2010 19:49:25 +0000 (+0200) Subject: utils: defer getting the classes until we actualy need them X-Git-Tag: RELEASE-0.10.26~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c09381ceffafec737332d296ca0ee511436708e;p=platform%2Fupstream%2Fgstreamer.git utils: defer getting the classes until we actualy need them This function has a lot of early returns. Give them soem more benefit. --- diff --git a/gst/gstutils.c b/gst/gstutils.c index 7264860..fc9339d 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -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);