aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-04 14:55:02 +0100
committerMax Kellermann <max@duempel.org>2009-01-04 14:55:02 +0100
commit55b6fd2f0c9b49f980d669e49dc6e04cbf4a769a (patch)
tree7d9e1d48fc113eeaab1d4eda3092ac83db78a3aa /src
parent96c18e7d159d5b4f38642982ed0b370f15b385e1 (diff)
downloadmpd-55b6fd2f0c9b49f980d669e49dc6e04cbf4a769a.tar.gz
mpd-55b6fd2f0c9b49f980d669e49dc6e04cbf4a769a.tar.xz
mpd-55b6fd2f0c9b49f980d669e49dc6e04cbf4a769a.zip
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.
Diffstat (limited to '')
-rw-r--r--src/player_thread.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index 55a3132bb..acaf7e123 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -451,6 +451,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;
}
}