Commit 2867c8e9 authored by Max Kellermann's avatar Max Kellermann

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.
parent 5c4dc8d0
...@@ -265,7 +265,8 @@ static void do_play(void) ...@@ -265,7 +265,8 @@ static void do_play(void)
} }
if (player.buffering) { 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 */ /* not enough decoded buffer space yet */
notify_wait(&pc.notify); notify_wait(&pc.notify);
continue; continue;
......
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