mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-25 07:26:29 +00:00
gsturi: Optimisation: Avoid type-checking in sorting method.
We already know the list only contains plugin features
This commit is contained in:
parent
a9ed7c0ec4
commit
517ab2860e
1 changed files with 2 additions and 5 deletions
|
@ -517,11 +517,8 @@ search_by_entry (GstPluginFeature * feature, gpointer search_entry)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
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) -
|
return gst_plugin_feature_get_rank (second) -
|
||||||
gst_plugin_feature_get_rank (first);
|
gst_plugin_feature_get_rank (first);
|
||||||
}
|
}
|
||||||
|
@ -603,7 +600,7 @@ gst_element_make_from_uri (const GstURIType type, const gchar * uri,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
possibilities = g_list_sort (possibilities, sort_by_rank);
|
possibilities = g_list_sort (possibilities, (GCompareFunc) sort_by_rank);
|
||||||
walk = possibilities;
|
walk = possibilities;
|
||||||
while (walk) {
|
while (walk) {
|
||||||
if ((ret =
|
if ((ret =
|
||||||
|
|
Loading…
Reference in a new issue