mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-07 13:30:07 -05:00
control: snd_ctl_ascii_elem_id_get() - do not show unset numid
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
1d1062d920
commit
7a1402cddc
1 changed files with 11 additions and 6 deletions
|
|
@ -116,14 +116,19 @@ static long long get_integer64(const char **ptr, long long min, long long max)
|
||||||
*/
|
*/
|
||||||
char *snd_ctl_ascii_elem_id_get(snd_ctl_elem_id_t *id)
|
char *snd_ctl_ascii_elem_id_get(snd_ctl_elem_id_t *id)
|
||||||
{
|
{
|
||||||
unsigned int index, device, subdevice;
|
unsigned int numid, index, device, subdevice;
|
||||||
char buf[256], buf1[32];
|
char buf[256], buf1[32];
|
||||||
|
const char *iface;
|
||||||
|
|
||||||
|
numid = snd_ctl_elem_id_get_numid(id);
|
||||||
|
iface = snd_ctl_elem_iface_name(snd_ctl_elem_id_get_interface(id));
|
||||||
|
if (numid > 0) {
|
||||||
snprintf(buf, sizeof(buf), "numid=%u,iface=%s,name='%s'",
|
snprintf(buf, sizeof(buf), "numid=%u,iface=%s,name='%s'",
|
||||||
snd_ctl_elem_id_get_numid(id),
|
numid, iface, snd_ctl_elem_id_get_name(id));
|
||||||
snd_ctl_elem_iface_name(
|
} else {
|
||||||
snd_ctl_elem_id_get_interface(id)),
|
snprintf(buf, sizeof(buf), "iface=%s,name='%s'",
|
||||||
snd_ctl_elem_id_get_name(id));
|
iface, snd_ctl_elem_id_get_name(id));
|
||||||
|
}
|
||||||
buf[sizeof(buf)-1] = '\0';
|
buf[sizeof(buf)-1] = '\0';
|
||||||
index = snd_ctl_elem_id_get_index(id);
|
index = snd_ctl_elem_id_get_index(id);
|
||||||
device = snd_ctl_elem_id_get_device(id);
|
device = snd_ctl_elem_id_get_device(id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue