mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-10 10:04:23 +00:00
preset: fix sorting presets
The glib docs are not clear on this, but the qsort man-page is - the GCompareDataFunc does not get the strings, but pointers to them.
This commit is contained in:
parent
3390b70d78
commit
70788b8578
1 changed files with 7 additions and 1 deletions
|
@ -428,6 +428,12 @@ preset_get_keyfile (GstPreset * preset)
|
|||
return presets;
|
||||
}
|
||||
|
||||
static gint
|
||||
compare_strings (gchar ** a, gchar ** b, gpointer user_data)
|
||||
{
|
||||
return g_strcmp0 (*a, *b);
|
||||
}
|
||||
|
||||
/* get a list of all supported preset names for an element */
|
||||
static gchar **
|
||||
gst_preset_default_get_preset_names (GstPreset * preset)
|
||||
|
@ -464,7 +470,7 @@ gst_preset_default_get_preset_names (GstPreset * preset)
|
|||
|
||||
/* sort the array now */
|
||||
g_qsort_with_data (groups, num_groups, sizeof (gchar *),
|
||||
(GCompareDataFunc) strcmp, NULL);
|
||||
(GCompareDataFunc) compare_strings, NULL);
|
||||
|
||||
return groups;
|
||||
|
||||
|
|
Loading…
Reference in a new issue