aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-15 22:47:08 +0200
committerMax Kellermann <max@duempel.org>2012-08-15 22:47:08 +0200
commit19ed233118bf2d3af07103dc80ceb6f5a3466b00 (patch)
tree885f23e382d44aeedb9b2d5a58b2759fe5c7a687 /src
parentfaa4fff4dd76b4f65752dec8865e4007986669d6 (diff)
downloadmpd-19ed233118bf2d3af07103dc80ceb6f5a3466b00.tar.gz
mpd-19ed233118bf2d3af07103dc80ceb6f5a3466b00.tar.xz
mpd-19ed233118bf2d3af07103dc80ceb6f5a3466b00.zip
playlist: fix unprotected player_control access
Diffstat (limited to 'src')
-rw-r--r--src/playlist.c6
1 files changed, 5 insertions, 1 deletions
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);
}
}