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.
This commit is contained in:
Sophie Hamilton 2017-09-26 04:06:26 +01:00
parent c9182a9878
commit 3feea66d16

View File

@ -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;