aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-29 18:35:10 +0100
committerMax Kellermann <max@duempel.org>2008-10-29 18:35:10 +0100
commit2867c8e9b1656c8f8a3c1a8a39a1fde13a0020cb (patch)
treefd8ba3ad2446fa65ed3296b524d8e8ee9f0ea81b
parent5c4dc8d03c8cfc77311a7f63282a35c9c7b82d1f (diff)
downloadmpd-2867c8e9b1656c8f8a3c1a8a39a1fde13a0020cb.tar.gz
mpd-2867c8e9b1656c8f8a3c1a8a39a1fde13a0020cb.tar.xz
mpd-2867c8e9b1656c8f8a3c1a8a39a1fde13a0020cb.zip
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.
-rw-r--r--src/player_thread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index b8bc92af8..35796d95d 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -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;