aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-03 23:29:50 +0100
committerMax Kellermann <max@duempel.org>2009-11-03 23:29:50 +0100
commit507606bb78d59c3f5ad18a4325b450d108daad67 (patch)
treec6f1aa17f35f0779abc66abff98c61b19d3f9ae6 /src
parentf421c8a191fed308af63fa4dd1d1412e3d8fbb57 (diff)
downloadmpd-507606bb78d59c3f5ad18a4325b450d108daad67.tar.gz
mpd-507606bb78d59c3f5ad18a4325b450d108daad67.tar.xz
mpd-507606bb78d59c3f5ad18a4325b450d108daad67.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/player_thread.c3
1 files changed, 2 insertions, 1 deletions
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);