Code

status_bar: fixed visible_bitrate check
authorMax Kellermann <max@duempel.org>
Sat, 3 Oct 2009 23:09:56 +0000 (01:09 +0200)
committerMax Kellermann <max@duempel.org>
Sat, 3 Oct 2009 23:09:56 +0000 (01:09 +0200)
Don't render the bit rate if total_time is unknown, and the
visible_bitrate is disabled.

src/status_bar.c

index ddffb8ee060f7c5ee577541ab89da0deebcc2953..4e0320639c733f368d5862890e1af331dc9ce314 100644 (file)
@@ -151,14 +151,16 @@ status_bar_paint(struct status_bar *p, const struct mpd_status *status,
                        g_snprintf(buffer, sizeof(buffer), "%s [%s/%s]",
                                   bitrate, elapsed_string, duration_string);
 #ifndef NCMPC_MINI
-               } else {
+               } else if (options.visible_bitrate) {
                        g_snprintf(buffer, sizeof(buffer),
                                   " [%d kbps]",
                                   mpd_status_get_kbit_rate(status));
 #endif
+               } else {
+                       buffer[0] = 0;
                }
-#ifndef NCMPC_MINI
        } else {
+#ifndef NCMPC_MINI
                if (options.display_time) {
                        time_t timep;