Code

screen_play: repaint highlight when mpd starts playing
authorMax Kellermann <max@duempel.org>
Sun, 28 Sep 2008 08:56:27 +0000 (10:56 +0200)
committerMax Kellermann <max@duempel.org>
Sun, 28 Sep 2008 08:56:27 +0000 (10:56 +0200)
When deciding whether to repaint the current highlight, test if MPD is
actually playing.  If MPD starts playing, repaint.

src/screen_play.c

index 4ee131c70cfa09edb33a55b0f7872aefab4c4ae0..25e82c7ee1011365691722ba3fa0cd265fe2ee51 100644 (file)
@@ -419,7 +419,8 @@ static void
 play_update(mpdclient_t *c)
 {
        static int prev_song_id;
-       int current_song_id = c->song != NULL ? c->song->id : 0;
+       int current_song_id = c->song != NULL && c->status != NULL &&
+               !IS_STOPPED(c->status->state) ? c->song->id : 0;
 
        if (current_song_id != prev_song_id) {
                prev_song_id = current_song_id;