From 507606bb78d59c3f5ad18a4325b450d108daad67 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 3 Nov 2009 23:29:50 +0100 Subject: player_thread: detect finished queued song When the decoder finishes the "queued" song very quickly (before the "current" song finishes playing), an assertion in do_play() fails because it thinks that it should start decoding the queued song, although that has in fact just finished. --- src/player_thread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/player_thread.c b/src/player_thread.c index 42c13bd27..d2c8ebfb3 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -817,7 +817,8 @@ static void do_play(struct decoder_control *dc) */ #endif - if (decoder_lock_is_idle(dc) && player.queued) { + if (decoder_lock_is_idle(dc) && player.queued && + dc->pipe == player.pipe) { /* the decoder has finished the current song; make it decode the next song */ assert(dc->pipe == NULL || dc->pipe == player.pipe); -- cgit v1.2.3