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.
This commit is contained in:
Max Kellermann 2009-01-21 16:17:57 +01:00
parent 2362ee4a48
commit b14e48f930

View File

@ -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 */