From d97634730540ae063746c5c59dc87d7299719171 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 28 Sep 2008 10:57:11 +0200 Subject: [PATCH] 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. --- src/screen_play.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/screen_play.c b/src/screen_play.c index 25e82c7..1bc2034 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); -- 2.30.2