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:
Max Kellermann 2009-03-26 19:49:36 +01:00
parent 0c9799babe
commit 3be1850744

View File

@ -52,8 +52,6 @@ alsa_mixer_init(const struct config_param *param)
am->control = config_get_block_string(param, "mixer_control",
VOLUME_MIXER_ALSA_CONTROL_DEFAULT);
am->volume_set = -1;
return &am->base;
}
@ -82,6 +80,8 @@ alsa_mixer_open(struct mixer *data)
int err;
snd_mixer_elem_t *elem;
am->volume_set = -1;
err = snd_mixer_open(&am->handle, 0);
snd_config_update_free_global();
if (err < 0) {