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.
This commit is contained in:
parent
aa7f5dec87
commit
9ee53bc76e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user