]> mj.ucw.cz Git - osdd.git/blobdiff - osd-alsa.c
osd-alsa: Do not emit a blank line
[osdd.git] / osd-alsa.c
index 3d7bc2731c91eec80c47f2ca5355c2af342786bd..86155a3cb2216f568e61b8db70ee48a4b8f85097 100644 (file)
@@ -12,6 +12,7 @@
 #include <getopt.h>
 #include <alsa/asoundlib.h>
 
 #include <getopt.h>
 #include <alsa/asoundlib.h>
 
+#include "util.h"
 #include "osd.h"
 
 static char *alsa_device = "default";
 #include "osd.h"
 
 static char *alsa_device = "default";
@@ -65,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;
       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++;
            {
              if (val)
                mute_off++;
@@ -91,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;
   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;
        {
          if (val > curr)
            curr = val;
@@ -125,7 +126,6 @@ static void show_mixer(void)
   char buf[256];
   snprintf(buf, sizeof(buf), "%s volume", mixer_control);
   osd_add_line(msg, NULL, buf);
   char buf[256];
   snprintf(buf, sizeof(buf), "%s volume", mixer_control);
   osd_add_line(msg, NULL, buf);
-  osd_add_line(msg, NULL, "");
   if (muted)
     osd_add_line(msg, NULL, "[mute]");
   else if (min < max)
   if (muted)
     osd_add_line(msg, NULL, "[mute]");
   else if (min < max)