aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-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);