Commit 9ee53bc7 authored by Max Kellermann's avatar Max Kellermann

player_thread: check pipe size again before exiting

When the decoder is finished, break out of the player loop only after another player.pipe check. We did check the pipe size a few lines above, but that check was kind of racy.
parent aa7f5dec
......@@ -730,7 +730,11 @@ static void do_play(void)
if (!player_song_border(&player))
break;
} else if (decoder_is_idle()) {
break;
/* check the size of the pipe again, because
the decoder thread may have added something
since we last checked */
if (music_pipe_size(player.pipe) == 0)
break;
} else {
/* the decoder is too busy and hasn't provided
new PCM data in time: send silence (if the
......
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