From 63181233bb2a28ccd3776d48aa2229df920c2ed3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Jan 2009 15:02:39 +0100 Subject: player_thread: fix cross-fading duplicate chunk bug When the decoder of the new song is not fast enough, the player thread has to wait for it for a moment. However the variable "nextChunk" was reset to -1 during that, making the next loop iteration assume that cross-fading has not begun yet. This patch overwrites it with "0" while waiting. --- src/player_thread.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/player_thread.c') diff --git a/src/player_thread.c b/src/player_thread.c index 7da412dfa..50e097a24 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -441,6 +441,14 @@ static void do_play(void) music_pipe_set_lazy(false); notify_signal(&dc.notify); notify_wait(&pc.notify); + + /* set nextChunk to a + non-negative value + so the next + iteration doesn't + assume crossfading + hasn't begun yet */ + nextChunk = 0; continue; } } -- cgit v1.2.3