alsa_mixer: initialize "volume_set" in the open() method
"volume_set" is an attribute which becomes undefined when the mixer is closed. That means, it must be initialized each time the mixer is opened.
This commit is contained in:
parent
0c9799babe
commit
3be1850744
@ -52,8 +52,6 @@ alsa_mixer_init(const struct config_param *param)
|
|||||||
am->control = config_get_block_string(param, "mixer_control",
|
am->control = config_get_block_string(param, "mixer_control",
|
||||||
VOLUME_MIXER_ALSA_CONTROL_DEFAULT);
|
VOLUME_MIXER_ALSA_CONTROL_DEFAULT);
|
||||||
|
|
||||||
am->volume_set = -1;
|
|
||||||
|
|
||||||
return &am->base;
|
return &am->base;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,6 +80,8 @@ alsa_mixer_open(struct mixer *data)
|
|||||||
int err;
|
int err;
|
||||||
snd_mixer_elem_t *elem;
|
snd_mixer_elem_t *elem;
|
||||||
|
|
||||||
|
am->volume_set = -1;
|
||||||
|
|
||||||
err = snd_mixer_open(&am->handle, 0);
|
err = snd_mixer_open(&am->handle, 0);
|
||||||
snd_config_update_free_global();
|
snd_config_update_free_global();
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user