From 3be1850744c71153ce12abe6cda3a751e714f8fb Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 26 Mar 2009 19:49:36 +0100 Subject: 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. --- src/mixer/alsa_mixer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mixer/alsa_mixer.c b/src/mixer/alsa_mixer.c index 75321408f..6c7476ab3 100644 --- a/src/mixer/alsa_mixer.c +++ b/src/mixer/alsa_mixer.c @@ -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) { -- cgit v1.2.3