From: Jaroslav Kysela Date: Thu, 29 Jul 1999 18:00:14 +0000 (+0000) Subject: Small '-l' fixes... X-Git-Tag: v1.0.3~456 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=b55e471c0cd496aa8c35512ef356910169a4185a;p=alsa-utils.git Small '-l' fixes... --- diff --git a/aplay/aplay.c b/aplay/aplay.c index 91f2036..4b8b983 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -200,34 +200,34 @@ static void device_list(void) pcminfo.flags & SND_PCM_INFO_PLAYBACK ? "playback " : "", pcminfo.flags & SND_PCM_INFO_CAPTURE ? "capture " : "", pcminfo.flags & SND_PCM_INFO_DUPLEX ? "duplex " : ""); - if ((err = snd_ctl_pcm_playback_info(handle, dev, &playinfo)) < 0) { - printf("Error: control digital audio playback info (%i): %s\n", card, snd_strerror(err)); - continue; - } if (pcminfo.flags & SND_PCM_INFO_PLAYBACK) { - printf(" Playback:\n"); - printf(" Rate range: %iHz-%iHz\n", playinfo.min_rate, playinfo.max_rate); - printf(" Voices range: %i-%i\n", playinfo.min_channels, playinfo.max_channels); - printf(" Formats:\n"); - for (idx = 0; idx < SND_PCM_SFMT_GSM; idx++) { - if (playinfo.formats & (1 << idx)) - printf(" %s%s\n", get_format(idx), - playinfo.hw_formats & (1 << idx) ? " [hardware]" : ""); - } - if ((err = snd_ctl_pcm_capture_info(handle, dev, &recinfo)) < 0) { - printf("Error: control digital audio capture info (%i): %s\n", card, snd_strerror(err)); - continue; + if ((err = snd_ctl_pcm_playback_info(handle, dev, &playinfo)) < 0) { + printf("Error: control digital audio playback info (%i): %s\n", card, snd_strerror(err)); + } else { + printf(" Playback:\n"); + printf(" Rate range: %iHz-%iHz\n", playinfo.min_rate, playinfo.max_rate); + printf(" Voices range: %i-%i\n", playinfo.min_channels, playinfo.max_channels); + printf(" Formats:\n"); + for (idx = 0; idx < SND_PCM_SFMT_GSM; idx++) { + if (playinfo.formats & (1 << idx)) + printf(" %s%s\n", get_format(idx), + playinfo.hw_formats & (1 << idx) ? " [hardware]" : ""); + } } } if (pcminfo.flags & SND_PCM_INFO_CAPTURE) { - printf(" Record:\n"); - printf(" Rate range: %iHz-%iHz\n", recinfo.min_rate, recinfo.max_rate); - printf(" Voices range: %i-%i\n", recinfo.min_channels, recinfo.max_channels); - printf(" Formats:\n"); - for (idx = 0; idx < SND_PCM_SFMT_GSM; idx++) { - if (recinfo.formats & (1 << idx)) - printf(" %s%s\n", get_format(idx), - recinfo.hw_formats & (1 << idx) ? " [hardware]" : ""); + if ((err = snd_ctl_pcm_capture_info(handle, dev, &recinfo)) < 0) { + printf("Error: control digital audio capture info (%i): %s\n", card, snd_strerror(err)); + } else { + printf(" Record:\n"); + printf(" Rate range: %iHz-%iHz\n", recinfo.min_rate, recinfo.max_rate); + printf(" Voices range: %i-%i\n", recinfo.min_channels, recinfo.max_channels); + printf(" Formats:\n"); + for (idx = 0; idx < SND_PCM_SFMT_GSM; idx++) { + if (recinfo.formats & (1 << idx)) + printf(" %s%s\n", get_format(idx), + recinfo.hw_formats & (1 << idx) ? " [hardware]" : ""); + } } } }