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
@ -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…
x
Reference in New Issue
Block a user