diff options
author | Max Kellermann <max@duempel.org> | 2009-03-26 19:49:36 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-26 19:49:36 +0100 |
commit | 3be1850744c71153ce12abe6cda3a751e714f8fb (patch) | |
tree | 18b64e633cbf9289d0259f41053472774dd472bc /src | |
parent | 0c9799babeba12ff62b77eeafba39e80cb1a4f6a (diff) | |
download | mpd-3be1850744c71153ce12abe6cda3a751e714f8fb.tar.gz mpd-3be1850744c71153ce12abe6cda3a751e714f8fb.tar.xz mpd-3be1850744c71153ce12abe6cda3a751e714f8fb.zip |
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.
Diffstat (limited to '')
-rw-r--r-- | src/mixer/alsa_mixer.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) { |