Allow specifying the max number of cards

Add --with-max-cards option to specify the max number of cards in
configure script, when the support for more than 32 cards is
required.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2013-05-24 17:21:15 +02:00
parent 14d653d7c3
commit 2f43b66c06
5 changed files with 20 additions and 6 deletions

View file

@ -103,7 +103,7 @@ int snd_card_next(int *rcard)
return -EINVAL;
card = *rcard;
card = card < 0 ? 0 : card + 1;
for (; card < 32; card++) {
for (; card < SND_MAX_CARDS; card++) {
if (snd_card_load(card)) {
*rcard = card;
return 0;
@ -134,7 +134,7 @@ int snd_card_get_index(const char *string)
(isdigit(*string) && isdigit(*(string + 1)) && *(string + 2) == 0)) {
if (sscanf(string, "%i", &card) != 1)
return -EINVAL;
if (card < 0 || card > 31)
if (card < 0 || card >= SND_MAX_CARDS)
return -EINVAL;
err = snd_card_load1(card);
if (err >= 0)
@ -143,7 +143,7 @@ int snd_card_get_index(const char *string)
}
if (string[0] == '/') /* device name */
return snd_card_load2(string);
for (card = 0; card < 32; card++) {
for (card = 0; card < SND_MAX_CARDS; card++) {
#ifdef SUPPORT_ALOAD
if (! snd_card_load(card))
continue;

View file

@ -382,7 +382,7 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
*handle = NULL;
if (CHECK_SANITY(card < 0 || card >= 32)) {
if (CHECK_SANITY(card < 0 || card >= SND_MAX_CARDS)) {
SNDMSG("Invalid card index %d", card);
return -EINVAL;
}