From 3feea66d16e4118a440812069833bc0a379225a4 Mon Sep 17 00:00:00 2001 From: Sophie Hamilton Date: Tue, 26 Sep 2017 04:06:26 +0100 Subject: [PATCH] linux-alsa: Display the "Custom" entry once only The "Custom" device entry was added inside the loop that runs for each device; this causes "Custom" to be added once for each device detected, or not at all if no device was detected. Moving this outside the loop (as would appear to have been the original intent, judging by the indentation) fixes this by adding the entry only after all devices have been processed. --- plugins/linux-alsa/alsa-input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/linux-alsa/alsa-input.c b/plugins/linux-alsa/alsa-input.c index e9fb2003e..c105d0d47 100644 --- a/plugins/linux-alsa/alsa-input.c +++ b/plugins/linux-alsa/alsa-input.c @@ -312,8 +312,6 @@ obs_properties_t * alsa_get_properties(void *unused) obs_property_list_add_string(devices, descr, name); - obs_property_list_add_string(devices, "Custom", "__custom__"); - next: if (name != NULL) free(name), name = NULL; @@ -326,6 +324,8 @@ obs_properties_t * alsa_get_properties(void *unused) ++hint; } + obs_property_list_add_string(devices, "Custom", "__custom__"); + snd_device_name_free_hint(hints); return props;