aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/audio/audio-alsa.c
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@iot.bzh>2016-01-05 15:45:34 +0100
committerManuel Bachmann <manuel.bachmann@iot.bzh>2016-01-05 15:45:34 +0100
commit12686e3f00eb942bf587e99f80654400cc6995b6 (patch)
tree35421892ad858c473c71004432e458ec62b8cf73 /plugins/audio/audio-alsa.c
parent9a4dbba322074fcdf9ab10fcda80805f6348344b (diff)
Fix set_mute in corner cases
Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Diffstat (limited to 'plugins/audio/audio-alsa.c')
-rw-r--r--plugins/audio/audio-alsa.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/audio/audio-alsa.c b/plugins/audio/audio-alsa.c
index afbff421..51f49702 100644
--- a/plugins/audio/audio-alsa.c
+++ b/plugins/audio/audio-alsa.c
@@ -227,18 +227,20 @@ PUBLIC unsigned char _alsa_get_mute (unsigned int num) {
return (unsigned char)!mute;
}
-PUBLIC void _alsa_set_mute (unsigned int num, unsigned char mute) {
+PUBLIC void _alsa_set_mute (unsigned int num, unsigned char tomute) {
snd_mixer_elem_t *elm_m;
+ int mute;
- if (!dev_ctx || !dev_ctx[num] || !dev_ctx[num]->mixer_elm || 1 < mute < 0)
+ if (!dev_ctx || !dev_ctx[num] || !dev_ctx[num]->mixer_elm || 1 < tomute < 0)
return;
if (dev_ctx[num]->mixer_elm_m) {
elm_m = dev_ctx[num]->mixer_elm_m;
- mute = !mute;
+ mute = (int)!tomute;
} else {
elm_m = dev_ctx[num]->mixer_elm;
+ mute = (int)tomute;
}
if (snd_mixer_selem_has_playback_switch (elm_m))