From: Martin Mares Date: Sun, 22 Jun 2014 13:13:05 +0000 (+0200) Subject: osd-alsa: Fixed bugs in error checking X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=5c759cd3747ca7c8ced1f6a87afe226f642efb14;p=osdd.git osd-alsa: Fixed bugs in error checking --- diff --git a/osd-alsa.c b/osd-alsa.c index 0a6429d..161924d 100644 --- a/osd-alsa.c +++ b/osd-alsa.c @@ -66,7 +66,7 @@ static int get_mute(void) for (snd_mixer_selem_channel_id_t ch=0; ch < SND_MIXER_SCHN_LAST; ch++) { int val; - if (snd_mixer_selem_get_playback_switch(elem, ch, &val)) + if (!snd_mixer_selem_get_playback_switch(elem, ch, &val)) { if (val) mute_off++; @@ -92,7 +92,7 @@ static long get_volume(long *pmin, long *pmax) for (snd_mixer_selem_channel_id_t ch=0; ch < SND_MIXER_SCHN_LAST; ch++) { long val; - if (snd_mixer_selem_get_playback_volume(elem, ch, &val)) + if (!snd_mixer_selem_get_playback_volume(elem, ch, &val)) { if (val > curr) curr = val;