mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:05:42 +01:00
alsactl: skip inactive controls
When using alsactl to save or restore the card settings, it currently skips over controls that don't have the appropriate read/write permissions. It should also skip over inactive controls, otherwise it will get an error when it tries to access that control, and will fail to save the card state (or fully restore it.) From: Dave Dillow <dave@thedillows.org>
This commit is contained in:
parent
beecc1419e
commit
b0828653c9
1 changed files with 4 additions and 2 deletions
|
@ -250,7 +250,8 @@ static int get_control(snd_ctl_t *handle, snd_ctl_elem_id_t *id, snd_config_t *t
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!snd_ctl_elem_info_is_readable(info))
|
if (snd_ctl_elem_info_is_inactive(info) ||
|
||||||
|
!snd_ctl_elem_info_is_readable(info))
|
||||||
return 0;
|
return 0;
|
||||||
snd_ctl_elem_value_set_id(ctl, id);
|
snd_ctl_elem_value_set_id(ctl, id);
|
||||||
err = snd_ctl_elem_read(handle, ctl);
|
err = snd_ctl_elem_read(handle, ctl);
|
||||||
|
@ -1306,7 +1307,8 @@ static int set_control(snd_ctl_t *handle, snd_config_t *control)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!snd_ctl_elem_info_is_writable(info))
|
if (snd_ctl_elem_info_is_inactive(info) ||
|
||||||
|
!snd_ctl_elem_info_is_writable(info))
|
||||||
return 0;
|
return 0;
|
||||||
snd_ctl_elem_value_set_numid(ctl, numid1);
|
snd_ctl_elem_value_set_numid(ctl, numid1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue