From 19ed233118bf2d3af07103dc80ceb6f5a3466b00 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 15 Aug 2012 22:47:08 +0200 Subject: playlist: fix unprotected player_control access --- src/playlist.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/playlist.c b/src/playlist.c index 0c9eea92d..d62865dd1 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -239,9 +239,13 @@ playlist_sync(struct playlist *playlist, struct player_control *pc) if (pc_next_song == NULL && playlist->queued != -1) playlist_song_started(playlist, pc); + player_lock(pc); + pc_next_song = pc->next_song; + player_unlock(pc); + /* make sure the queued song is always set (if possible) */ - if (pc->next_song == NULL && playlist->queued < 0) + if (pc_next_song == NULL && playlist->queued < 0) playlist_update_queued_song(playlist, pc, NULL); } } -- cgit v1.2.3