summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dfd01eb)
raw | patch | inline | side by side (parent: dfd01eb)
author | Max Kellermann <max@duempel.org> | |
Thu, 11 Jun 2009 15:24:20 +0000 (17:24 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 11 Jun 2009 15:24:20 +0000 (17:24 +0200) |
Don't check "status != NULL" each time we need the MPD state.
src/screen.c | patch | blob | history |
diff --git a/src/screen.c b/src/screen.c
index b8102d670916608c410f373805cf345f3928bae0..929766b998a8593306af867207f026285a133451 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
{
WINDOW *w = screen.status_window.w;
mpd_Status *status = c->status;
+ int state;
mpd_Song *song = c->song;
int elapsedTime = 0;
#ifdef NCMPC_MINI
wclrtoeol(w);
colors_use(w, COLOR_STATUS_BOLD);
- switch (status == NULL ? MPD_STATUS_STATE_STOP : status->state) {
+ state = status == NULL ? MPD_STATUS_STATE_UNKNOWN : status->state;
+
+ switch (state) {
case MPD_STATUS_STATE_PLAY:
str = _("Playing:");
break;
/* create time string */
memset(screen.buf, 0, screen.buf_size);
- if (status != NULL && (IS_PLAYING(status->state) ||
- IS_PAUSED(status->state))) {
+ if (IS_PLAYING(state) || IS_PAUSED(state)) {
if (status->totalTime > 0) {
/*checks the conf to see whether to display elapsed or remaining time */
if(!strcmp(options.timedisplay_type,"elapsed"))