Commit b14e48f9 authored by Max Kellermann's avatar Max Kellermann

player_thread: request next song only if new one starts playing

The player_thread loop requests the next song from the playlist as soon as the decoder finishes the song which is currently being played. This is superfluous, and can lead to synchronization errors and wrong results. The playlist already knows when the player starts playing the next song (player_wait_for_decoder() triggers the PLAYLIST event), and will then trigger the scheduler to provide the next song.
parent 2362ee4a
......@@ -372,17 +372,6 @@ 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;
event_pipe_emit(PIPE_EVENT_PLAYLIST);
}
if (decoder_is_idle() && player.queued) {
/* the decoder has finished the current song;
make it decode the next song */
......
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