projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a4e561c
)
preset: don't return empty preset lists
author
Stefan Sauer
<ensonic@users.sf.net>
Sun, 4 Jan 2015 22:24:53 +0000
(23:24 +0100)
committer
Stefan Sauer
<ensonic@users.sf.net>
Sun, 4 Jan 2015 22:26:19 +0000
(23:26 +0100)
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.
gst/gstpreset.c
patch
|
blob
|
history
diff --git
a/gst/gstpreset.c
b/gst/gstpreset.c
index
6953508
..
ee5a4a5
100644
(file)
--- a/
gst/gstpreset.c
+++ b/
gst/gstpreset.c
@@
-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);