summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6ca92d8)
raw | patch | inline | side by side (parent: 6ca92d8)
author | Max Kellermann <max@duempel.org> | |
Sun, 28 Sep 2008 08:57:11 +0000 (10:57 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 28 Sep 2008 08:57:11 +0000 (10:57 +0200) |
"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.
playing at all. This way, ncmpc cannot see the difference between
"song 0 playing" and "not playing". Change "not playing" to -1.
src/screen_play.c | patch | blob | history |
diff --git a/src/screen_play.c b/src/screen_play.c
index 25e82c7ee1011365691722ba3fa0cd265fe2ee51..1bc2034b82d7d26557b8fb6a3fe29576f6deb0ae 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.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);