aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@iot.bzh>2015-12-29 21:11:44 +0100
committerManuel Bachmann <manuel.bachmann@iot.bzh>2015-12-29 21:11:44 +0100
commit93daafca4d0419707cdcde181180a689a7fccbfb (patch)
treee42e1ba9024e2b987f2b0859f40e36b44defe77d
parent33853cf814a4ba360a990ffd6f1246a996819f12 (diff)
Fix mute status for Porter/Koelsch
Mute status on Porter/Koelsch is reversed, take this into account. Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
-rw-r--r--plugins/audio/audio-alsa.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/audio/audio-alsa.c b/plugins/audio/audio-alsa.c
index 8a4caf21..afbff421 100644
--- a/plugins/audio/audio-alsa.c
+++ b/plugins/audio/audio-alsa.c
@@ -221,7 +221,10 @@ PUBLIC unsigned char _alsa_get_mute (unsigned int num) {
snd_mixer_selem_get_playback_switch (elm_m, SND_MIXER_SCHN_FRONT_RIGHT, &mute);
}
- return (unsigned char)!mute;
+ if (dev_ctx[num]->mixer_elm_m)
+ return (unsigned char)mute;
+ else
+ return (unsigned char)!mute;
}
PUBLIC void _alsa_set_mute (unsigned int num, unsigned char mute) {
@@ -231,8 +234,12 @@ PUBLIC void _alsa_set_mute (unsigned int num, unsigned char mute) {
if (!dev_ctx || !dev_ctx[num] || !dev_ctx[num]->mixer_elm || 1 < mute < 0)
return;
- dev_ctx[num]->mixer_elm_m ? (elm_m = dev_ctx[num]->mixer_elm_m) :
- (elm_m = dev_ctx[num]->mixer_elm);
+ if (dev_ctx[num]->mixer_elm_m) {
+ elm_m = dev_ctx[num]->mixer_elm_m;
+ mute = !mute;
+ } else {
+ elm_m = dev_ctx[num]->mixer_elm;
+ }
if (snd_mixer_selem_has_playback_switch (elm_m))
snd_mixer_selem_set_playback_switch_all (elm_m, !mute);