Commit 55b6fd2f authored by Max Kellermann's avatar Max Kellermann

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.
parent 96c18e7d
...@@ -12,6 +12,7 @@ ver 0.15 - (200?/??/??) ...@@ -12,6 +12,7 @@ ver 0.15 - (200?/??/??)
* failure to read the state file is non-fatal * failure to read the state file is non-fatal
* fix minor memory leak in decoder_tag() * fix minor memory leak in decoder_tag()
* added Icy-Metadata support * added Icy-Metadata support
* fix cross-fading bug: it used to play some chunks of the new song twice
ver 0.14 (2008/12/25) ver 0.14 (2008/12/25)
* audio outputs: * audio outputs:
......
...@@ -451,6 +451,14 @@ static void do_play(void) ...@@ -451,6 +451,14 @@ static void do_play(void)
music_pipe_set_lazy(false); music_pipe_set_lazy(false);
notify_signal(&dc.notify); notify_signal(&dc.notify);
notify_wait(&pc.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; continue;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment