From fe8895120e565f83f18fb3c0af7a0bbbc881e5d9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 18 Sep 2008 01:55:45 +0200 Subject: playlist: removed "updated" flag The caller may check the playlist.id instead of checking the old "updated" flag. --- src/screen_play.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/screen_play.c') diff --git a/src/screen_play.c b/src/screen_play.c index c89d150cf..cd43982c3 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -51,6 +51,7 @@ typedef struct } completion_callback_data_t; static list_window_t *lw = NULL; +static long long playlist_id; static void playlist_changed_callback(mpdclient_t *c, int event, gpointer data) @@ -398,14 +399,14 @@ play_update(screen_t *screen, mpdclient_t *c) } } - if( c->playlist.updated ) { + if (c->playlist.id != playlist_id) { if (lw->selected >= c->playlist.list->len) lw->selected = c->playlist.list->len - 1; if (lw->start >= c->playlist.list->len) list_window_reset(lw); play_paint(screen, c); - c->playlist.updated = FALSE; + playlist_id = c->playlist.id; } else if( lw->repaint || 1) { list_window_paint(lw, list_callback, (void *) c); wnoutrefresh(lw->w); -- cgit v1.2.3