mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
preset: don't return empty preset lists
Add a shortcut for the cases where an element implements the preset iface but has no presets and return NULL instead of an empty list in that case.
This commit is contained in:
parent
a4e561c7f8
commit
266481e9ff
1 changed files with 6 additions and 0 deletions
|
@ -456,6 +456,12 @@ gst_preset_default_get_preset_names (GstPreset * preset)
|
|||
groups[num_groups] = NULL;
|
||||
}
|
||||
}
|
||||
if (!num_groups) {
|
||||
GST_INFO_OBJECT (preset, "Empty preset file");
|
||||
g_strfreev (groups);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* sort the array now */
|
||||
g_qsort_with_data (groups, num_groups, sizeof (gchar *),
|
||||
(GCompareDataFunc) strcmp, NULL);
|
||||
|
|
Loading…
Reference in a new issue