]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Fixes for multiple soundcards and joystick address.
authorJaroslav Kysela <perex@perex.cz>
Sat, 5 Dec 1998 11:19:22 +0000 (11:19 +0000)
committerJaroslav Kysela <perex@perex.cz>
Sat, 5 Dec 1998 11:19:22 +0000 (11:19 +0000)
alsactl/setup.c

index 9a901c0cc2247982507634d378d743951279b5a5..d6fa8aa6bd60562027434b36a67ee3c9dde95f3f 100644 (file)
@@ -559,7 +559,12 @@ static void soundcard_setup_write_switch(FILE * out, int interface, const unsign
                break;
        case SND_CTL_SW_TYPE_WORD:
                s = "word";
-               sprintf(v, "%u", (unsigned int) pdata->data16[0]);
+               if (interface == SND_INTERFACE_CONTROL &&
+                   !strcmp(name, SND_CTL_SW_JOYSTICK_ADDRESS)) {
+                       sprintf(v, "0x%x", (unsigned int) pdata->data16[0]);
+               } else {
+                       sprintf(v, "%u", (unsigned int) pdata->data16[0]);
+               }
                break;
        case SND_CTL_SW_TYPE_DWORD:
                s = "dword";
@@ -864,8 +869,10 @@ int soundcard_setup_process(int cardno)
                                        }
                        }
                }
+               if(ctlhandle) {
+                       snd_ctl_close(ctlhandle);
+                       ctlhandle = NULL;
+               }
        }
-       if (ctlhandle)
-               snd_ctl_close(ctlhandle);
        return 1;
 }