mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-09 17:15:43 +01:00
aplay/arecord - use snd_device_name_hint() for -L command
This commit is contained in:
parent
f0d1e3cac6
commit
f6ed3aa3be
1 changed files with 13 additions and 13 deletions
|
@ -280,21 +280,21 @@ static void device_list(void)
|
|||
|
||||
static void pcm_list(void)
|
||||
{
|
||||
snd_config_t *conf;
|
||||
snd_output_t *out;
|
||||
int err = snd_config_update();
|
||||
if (err < 0) {
|
||||
error("snd_config_update: %s", snd_strerror(err));
|
||||
char **hints, **n, *delim;
|
||||
|
||||
if (snd_device_name_hint(-1, SND_CTL_ELEM_IFACE_PCM, &hints) < 0)
|
||||
return;
|
||||
n = hints;
|
||||
while (*n != NULL) {
|
||||
delim = strchr(*n, '|');
|
||||
if (delim)
|
||||
*delim = '\0';
|
||||
printf("%s\n", *n);
|
||||
if (delim)
|
||||
printf(" %s\n", delim + 1);
|
||||
n++;
|
||||
}
|
||||
err = snd_output_stdio_attach(&out, stdout, 0);
|
||||
assert(err >= 0);
|
||||
err = snd_config_search(snd_config, "pcm", &conf);
|
||||
if (err < 0)
|
||||
return;
|
||||
printf(_("PCM list:\n"));
|
||||
snd_config_save(conf, out);
|
||||
snd_output_close(out);
|
||||
snd_device_name_free_hint(hints);
|
||||
}
|
||||
|
||||
static void version(void)
|
||||
|
|
Loading…
Reference in a new issue