mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-05 17:09:48 +00:00
gsturi: Sort by feature name to break a feature rank tie
This matches autoplug in other places such as decodebin, otherwise we will pick "randomly" based on the order in which plugins are registered, which is mostly dependent on the order in which readdir() returns items. So let's make it predictable. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6348>
This commit is contained in:
parent
acd40e7852
commit
fa387a3eb7
1 changed files with 5 additions and 1 deletions
|
@ -564,8 +564,12 @@ search_by_entry (GstPluginFeature * feature, gpointer search_entry)
|
|||
static gint
|
||||
sort_by_rank (GstPluginFeature * first, GstPluginFeature * second)
|
||||
{
|
||||
return gst_plugin_feature_get_rank (second) -
|
||||
int diff = gst_plugin_feature_get_rank (second) -
|
||||
gst_plugin_feature_get_rank (first);
|
||||
if (diff == 0)
|
||||
diff = g_strcmp0 (gst_plugin_feature_get_name (first),
|
||||
gst_plugin_feature_get_name (second));
|
||||
return diff;
|
||||
}
|
||||
|
||||
static GList *
|
||||
|
|
Loading…
Reference in a new issue