player: handle songs shorter than the initial buffer

When the decoder exited before the buffer has grown big enough
("buffer_before_play"), the player thread waited forever.  Add an
additional check which disables buffering as soon as the decoder
exits.
This commit is contained in:
Max Kellermann 2008-10-29 18:35:10 +01:00
parent 5c4dc8d03c
commit 2867c8e9b1

View File

@ -265,7 +265,8 @@ static void do_play(void)
}
if (player.buffering) {
if (ob_available() < pc.buffered_before_play) {
if (ob_available() < pc.buffered_before_play &&
!decoder_is_idle()) {
/* not enough decoded buffer space yet */
notify_wait(&pc.notify);
continue;