From: Takashi Iwai Date: Thu, 27 Nov 2003 11:07:25 +0000 (+0000) Subject: - fixed the infinite loop in probing a card control. X-Git-Tag: v1.0.3~28 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=911e5f72483b74804ac1bc21e5590f37edf46500;p=alsa-utils.git - fixed the infinite loop in probing a card control. --- diff --git a/aplay/aplay.c b/aplay/aplay.c index ee1f0ed..e12589c 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -199,12 +199,12 @@ static void device_list(void) sprintf(name, "hw:%d", card); if ((err = snd_ctl_open(&handle, name, 0)) < 0) { error("control open (%i): %s", card, snd_strerror(err)); - continue; + goto next_card; } if ((err = snd_ctl_card_info(handle, info)) < 0) { error("control hardware info (%i): %s", card, snd_strerror(err)); snd_ctl_close(handle); - continue; + goto next_card; } fprintf(stderr, "**** List of %s Hardware Devices ****\n", snd_pcm_stream_name(stream)); dev = -1; @@ -239,6 +239,7 @@ static void device_list(void) } } snd_ctl_close(handle); + next_card: if (snd_card_next(&card) < 0) { error("snd_card_next"); break;