From 911e5f72483b74804ac1bc21e5590f37edf46500 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 27 Nov 2003 11:07:25 +0000 Subject: [PATCH] - fixed the infinite loop in probing a card control. --- aplay/aplay.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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;