diff options
author | Simon Wilson <simonwilson@google.com> | 2011-06-02 15:58:41 -0700 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2011-06-02 15:58:41 -0700 |
commit | 1bd580fcba8f8dc4587d5d8c42edd85857b11b65 (patch) | |
tree | 73f41a41500cef31d7782bf788fc17dd5dc71314 /mixer.c | |
parent | 851aa5cc1596af6236c6105a92fb3b575ecb5c1c (diff) |
Support multiple cards and devices
Diffstat (limited to 'mixer.c')
-rw-r--r-- | mixer.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -111,7 +111,7 @@ void mixer_close(struct mixer *mixer) /* TODO: verify frees */ } -struct mixer *mixer_open(unsigned int device) +struct mixer *mixer_open(unsigned int card) { struct snd_ctl_elem_list elist; struct snd_ctl_elem_info tmp; @@ -119,8 +119,10 @@ struct mixer *mixer_open(unsigned int device) struct mixer *mixer = NULL; unsigned int n, m; int fd; + char fn[256]; - fd = open("/dev/snd/controlC0", O_RDWR); + snprintf(fn, sizeof(fn), "/dev/snd/controlC%u", card); + fd = open(fn, O_RDWR); if (fd < 0) return 0; |