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.
This commit is contained in:
Max Kellermann 2009-11-03 23:29:50 +01:00
parent f421c8a191
commit 507606bb78

View File

@ -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);