]> mj.ucw.cz Git - osdd.git/blobdiff - osd-alsa.c
osd-alsa: Fixed bugs in error checking
[osdd.git] / osd-alsa.c
index 0a6429d468edf394ea934bfc78c8632473024c68..161924daedba14c49cd885343c1345438a35fdec 100644 (file)
@@ -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;