diff options
author | Max Kellermann <max@duempel.org> | 2008-09-28 10:57:11 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-28 10:57:11 +0200 |
commit | d97634730540ae063746c5c59dc87d7299719171 (patch) | |
tree | c8cbf32eba54c1a6da5917a61fbbd74f5b7426f4 /src/screen_play.c | |
parent | 6ca92d80ddb859fef30f45c71556f5296127875f (diff) | |
download | mpd-d97634730540ae063746c5c59dc87d7299719171.tar.gz mpd-d97634730540ae063746c5c59dc87d7299719171.tar.xz mpd-d97634730540ae063746c5c59dc87d7299719171.zip |
screen_play: no song means id=-1
"prev_song_id" and "current_song_id" had value 0 if MPD was not
playing at all. This way, ncmpc cannot see the difference between
"song 0 playing" and "not playing". Change "not playing" to -1.
Diffstat (limited to '')
-rw-r--r-- | src/screen_play.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/screen_play.c b/src/screen_play.c index 25e82c7ee..1bc2034b8 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -418,15 +418,15 @@ play_paint(mpdclient_t *c) static void play_update(mpdclient_t *c) { - static int prev_song_id; + static int prev_song_id = -1; int current_song_id = c->song != NULL && c->status != NULL && - !IS_STOPPED(c->status->state) ? c->song->id : 0; + !IS_STOPPED(c->status->state) ? c->song->id : -1; if (current_song_id != prev_song_id) { prev_song_id = current_song_id; /* center the cursor */ - if (options.auto_center && current_song_id != 0) + if (options.auto_center && current_song_id != -1) center_playing_item(c); playlist_repaint(c); |