aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-14 17:55:51 +0100
committerMax Kellermann <max@duempel.org>2008-11-14 17:55:51 +0100
commiteb199ca207d69512d671607ddd9c2f3f9ac5c668 (patch)
tree57b911aa4754780601c4a61db7f17398c7de68ac
parent418dac6f946eca40f2140c11301ce492b7d16a43 (diff)
downloadmpd-eb199ca207d69512d671607ddd9c2f3f9ac5c668.tar.gz
mpd-eb199ca207d69512d671607ddd9c2f3f9ac5c668.tar.xz
mpd-eb199ca207d69512d671607ddd9c2f3f9ac5c668.zip
player: don't queue song when there are 2 songs in the pipe
Don't send a "next song" request to the main thread when the current song hasn't started playing yet, i.e. there are already two different songs in the music pipe. This would erase information about the song boundary within the music pipe, and thus triggered an assertion failure. The bug could occur when playing very short songs which fit into the pipe as a whole.
-rw-r--r--src/player_thread.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index 7570443da..ac060dda5 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -153,6 +153,9 @@ static void player_process_command(struct player *player)
case PLAYER_COMMAND_QUEUE:
assert(pc.next_song != NULL);
+ assert(!player->queued);
+ assert(player->next_song_chunk == -1);
+
player->queued = true;
player_command_finished();
break;
@@ -352,10 +355,12 @@ static void do_play(void)
#endif
if (decoder_is_idle() && !player.queued &&
+ player.next_song_chunk < 0 &&
pc.next_song != NULL &&
pc.command == PLAYER_COMMAND_NONE) {
/* the decoder has finished the current song;
request the next song from the playlist */
+
pc.next_song = NULL;
wakeup_main_task();
}