summaryrefslogtreecommitdiff
path: root/src/print_volume.c
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2012-10-03 15:12:49 +0200
committerMichael Stapelberg <michael@stapelberg.de>2012-10-03 15:12:49 +0200
commit7dcc961fa2d755ed47b29de778a2d2baf8dac7ba (patch)
treee04507e29b993ff939a46f3c68764a51e0743b26 /src/print_volume.c
parent266734418caa8c9e0d7bc9c1fe67c45151f8a433 (diff)
Bugfix: Move the pbval definition outside the ifdef (Thanks XTaran)
This fixes compilation on !linux
Diffstat (limited to 'src/print_volume.c')
-rw-r--r--src/print_volume.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/print_volume.c b/src/print_volume.c
index 95a3601..9c69d08 100644
--- a/src/print_volume.c
+++ b/src/print_volume.c
@@ -51,6 +51,7 @@ static void free_hdl(struct mixer_hdl *hdl) {
void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char *device, const char *mixer, int mixer_idx) {
char *outwalk = buffer;
+ int pbval = 1;
/* Printing volume only works with ALSA at the moment */
if (output_format == O_I3BAR) {
@@ -152,7 +153,6 @@ void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char *
} else avg = (int)val;
/* Check for mute */
- int pbval;
if (snd_mixer_selem_has_playback_switch(hdl->elem)) {
if ((err = snd_mixer_selem_get_playback_switch(hdl->elem, 0, &pbval)) < 0)
fprintf (stderr, "i3status: ALSA: playback_switch: %s\n", snd_strerror(err));