aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer_control.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-12 18:40:03 +0100
committerMax Kellermann <max@duempel.org>2009-03-12 18:40:03 +0100
commit0bc7f584f44803cda2c0a3d36dbef127161663d6 (patch)
treed7fbb1122d991d528ffda2c8958d26949bf75ee0 /src/mixer_control.c
parentc37567a14f13dc7edda326d8b9b2253daeee87ba (diff)
downloadmpd-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 'src/mixer_control.c')
-rw-r--r--src/mixer_control.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mixer_control.c b/src/mixer_control.c
index a43230d5a..f583696e8 100644
--- a/src/mixer_control.c
+++ b/src/mixer_control.c
@@ -33,6 +33,9 @@ mixer_control_setvol(unsigned int device, int volume, int rel)
assert(device < audio_output_count());
output = audio_output_get(device);
+ if (!output->enabled)
+ return false;
+
mixer = ao_plugin_get_mixer(output->plugin, output->data);
if (mixer != NULL) {
if (rel) {
@@ -61,6 +64,9 @@ mixer_control_getvol(unsigned int device, int *volume)
assert(device < audio_output_count());
output = audio_output_get(device);
+ if (!output->enabled)
+ return false;
+
mixer = ao_plugin_get_mixer(output->plugin, output->data);
if (mixer != NULL) {
int volume2;