diff options
author | Max Kellermann <max@duempel.org> | 2009-03-12 18:40:03 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-12 18:40:03 +0100 |
commit | 0bc7f584f44803cda2c0a3d36dbef127161663d6 (patch) | |
tree | d7fbb1122d991d528ffda2c8958d26949bf75ee0 /src/output_command.c | |
parent | c37567a14f13dc7edda326d8b9b2253daeee87ba (diff) | |
download | mpd-0bc7f584f44803cda2c0a3d36dbef127161663d6.tar.gz mpd-0bc7f584f44803cda2c0a3d36dbef127161663d6.tar.xz mpd-0bc7f584f44803cda2c0a3d36dbef127161663d6.zip |
mixer_control: don't touch mixers of disabled outputs
When an audio output device is disabled, also disable its mixer.
Diffstat (limited to '')
-rw-r--r-- | src/output_command.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/output_command.c b/src/output_command.c index 2e33ca8b8..13cd62b88 100644 --- a/src/output_command.c +++ b/src/output_command.c @@ -26,6 +26,8 @@ #include "output_command.h" #include "output_all.h" #include "output_internal.h" +#include "output_plugin.h" +#include "mixer_api.h" #include "idle.h" bool @@ -48,6 +50,7 @@ bool audio_output_disable_index(unsigned idx) { struct audio_output *ao; + struct mixer *mixer; if (idx >= audio_output_count()) return false; @@ -57,5 +60,11 @@ audio_output_disable_index(unsigned idx) ao->enabled = false; idle_add(IDLE_OUTPUT); + mixer = ao_plugin_get_mixer(ao->plugin, ao->data); + if (mixer != NULL) { + mixer_close(mixer); + idle_add(IDLE_MIXER); + } + return true; } |