From: Jonathan Neuschäfer Date: Sat, 19 Nov 2011 01:33:43 +0000 (+0100) Subject: screen_song: don't show unknown kbit rates X-Git-Tag: release-0.20~51 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7f584c2a084ad6965d6c674470a99778f99defe3;p=ncmpc.git screen_song: don't show unknown kbit rates (calling mpd_status_get_kbit_rate twice in a row shouldn't impact performance, it's declared as "pure") --- diff --git a/src/screen_song.c b/src/screen_song.c index e738fc2..9154f9a 100644 --- a/src/screen_song.c +++ b/src/screen_song.c @@ -311,7 +311,8 @@ screen_song_add_song(const struct mpd_song *song, const struct mpdclient *c) screen_song_append(_("Path"), mpd_song_get_uri(song), max_tag_label_width); if (mpdclient_is_playing(c) && c->song != NULL && - strcmp(mpd_song_get_uri(c->song), mpd_song_get_uri(song)) == 0) { + strcmp(mpd_song_get_uri(c->song), mpd_song_get_uri(song)) == 0 && + mpd_status_get_kbit_rate(c->status)) { char buf[16]; g_snprintf(buf, sizeof(buf), _("%d kbps"), mpd_status_get_kbit_rate(c->status));