X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fscreen.c;h=9bbfda742ff2a32afd7c82d78ac26cd03e02af86;hb=ccc71047bee191463d8dffa0fd28bfb32984613e;hp=5d6e4091698cc70b61635b7fbdaab4dfe945f58d;hpb=b871878b86a7876cd54e30d6be2bfb57f461dbb1;p=ncmpc.git diff --git a/src/screen.c b/src/screen.c index 5d6e409..9bbfda7 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1,5 +1,5 @@ /* ncmpc (Ncurses MPD Client) - * (c) 2004-2009 The Music Player Daemon Project + * (c) 2004-2010 The Music Player Daemon Project * Project homepage: http://musicpd.org * This program is free software; you can redistribute it and/or modify @@ -158,12 +158,12 @@ update_progress_window(struct mpdclient *c, bool repaint) { unsigned elapsed, duration; - if (c->song != NULL && seek_id == (int)mpd_song_get_id(c->song)) + if (c->status == NULL) + elapsed = 0; + else if (seek_id >= 0 && seek_id == mpd_status_get_song_id(c->status)) elapsed = seek_target_time; - else if (c->status != NULL) - elapsed = mpd_status_get_elapsed_time(c->status); else - elapsed = 0; + elapsed = mpd_status_get_elapsed_time(c->status); duration = mpdclient_is_playing(c) ? mpd_status_get_total_time(c->status)