aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-03 23:32:37 +0100
committerMax Kellermann <max@duempel.org>2009-11-03 23:32:37 +0100
commita22c93b659aceaefb0e72d0dedd554971455c02c (patch)
treec0893be4bd4e4db789736259d6613383e7b86162 /src/player_thread.c
parent507606bb78d59c3f5ad18a4325b450d108daad67 (diff)
downloadmpd-a22c93b659aceaefb0e72d0dedd554971455c02c.tar.gz
mpd-a22c93b659aceaefb0e72d0dedd554971455c02c.tar.xz
mpd-a22c93b659aceaefb0e72d0dedd554971455c02c.zip
player_thread: on return, reset next_song only if queued
If no song was queued, then player_control.next_song might contain the value for the next QUEUE command. We must not reset that.
Diffstat (limited to 'src/player_thread.c')
-rw-r--r--src/player_thread.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index d2c8ebfb3..5cb73a3ee 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -889,14 +889,18 @@ static void do_play(struct decoder_control *dc)
player_dc_stop(&player);
- assert(!player.queued || pc.next_song != NULL);
- pc.next_song = NULL;
-
music_pipe_clear(player.pipe, player_buffer);
music_pipe_free(player.pipe);
player_lock();
+
+ if (player.queued) {
+ assert(pc.next_song != NULL);
+ pc.next_song = NULL;
+ }
+
pc.state = PLAYER_STATE_STOP;
+
player_unlock();
event_pipe_emit(PIPE_EVENT_PLAYLIST);