alsa: don't enumerate virtual devices, just physical hardware.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 15 Aug 2016 10:09:41 -0400
changeset 10282 9bbe05f2612a
parent 10281 cb13d22b7f09
child 10283 9a277db2806d
alsa: don't enumerate virtual devices, just physical hardware.
src/audio/alsa/SDL_alsa_audio.c
--- a/src/audio/alsa/SDL_alsa_audio.c	Fri Aug 26 12:18:08 2016 -0700
+++ b/src/audio/alsa/SDL_alsa_audio.c	Mon Aug 15 10:09:41 2016 -0400
@@ -714,12 +714,15 @@
         char *desc = ALSA_snd_device_name_get_hint(hints[i], "DESC");
         char *ioid = ALSA_snd_device_name_get_hint(hints[i], "IOID");
 
-        if ((ioid == NULL) || (SDL_strcmp(ioid, "Output") == 0)) {
-            add_device(SDL_FALSE, name, desc);
-        }
+        /* only want physical hardware interfaces */
+        if (SDL_strncmp(name, "hw:", 3) == 0) {
+            if ((ioid == NULL) || (SDL_strcmp(ioid, "Output") == 0)) {
+                add_device(SDL_FALSE, name, desc);
+            }
 
-        if ((ioid == NULL) || (SDL_strcmp(ioid, "Input") == 0)) {
-            add_device(SDL_TRUE, name, desc);
+            if ((ioid == NULL) || (SDL_strcmp(ioid, "Input") == 0)) {
+                add_device(SDL_TRUE, name, desc);
+            }
         }
 
         free(name);