summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2009-10-22 13:15:15 +0200
committerEdward Hervey <bilboed@bilboed.com>2009-10-22 13:16:07 +0200
commit517ab2860e90b2c6d255096dd02409434f4bb62b (patch)
tree929ffc8c50b04401a97f516a7146080e2b534030
parenta9ed7c0ec4c3a67fb25253463854f6f1a7407edc (diff)
gsturi: Optimisation: Avoid type-checking in sorting method.
We already know the list only contains plugin features
-rw-r--r--gst/gsturi.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gst/gsturi.c b/gst/gsturi.c
index ab9c4bba03..4065abd394 100644
--- a/gst/gsturi.c
+++ b/gst/gsturi.c
@@ -517,11 +517,8 @@ search_by_entry (GstPluginFeature * feature, gpointer search_entry)
}
static gint
-sort_by_rank (gconstpointer a, gconstpointer b)
+sort_by_rank (GstPluginFeature * first, GstPluginFeature * second)
{
- GstPluginFeature *first = GST_PLUGIN_FEATURE (a);
- GstPluginFeature *second = GST_PLUGIN_FEATURE (b);
-
return gst_plugin_feature_get_rank (second) -
gst_plugin_feature_get_rank (first);
}
@@ -603,7 +600,7 @@ gst_element_make_from_uri (const GstURIType type, const gchar * uri,
return NULL;
}
- possibilities = g_list_sort (possibilities, sort_by_rank);
+ possibilities = g_list_sort (possibilities, (GCompareFunc) sort_by_rank);
walk = possibilities;
while (walk) {
if ((ret =