From f25ff426390cc50bc601ea7cfc7c04b56b06621b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 12 Apr 2008 04:13:41 +0000 Subject: [PATCH] sleep when waiting for cross-fade chunks When there are not enough decode cross-fade chunks in the buffer yet, the current code does busy-wait, which will delay the decoder even more. sleep instead, expecting the decoder to wake us up. git-svn-id: https://svn.musicpd.org/mpd/trunk@7272 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/decode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/decode.c b/src/decode.c index 84eeada3f..145f034b1 100644 --- a/src/decode.c +++ b/src/decode.c @@ -536,10 +536,12 @@ static void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer * running, abort cross fading */ doCrossFade = -1; - } else + } else { /* wait for the decoder */ + player_sleep(); continue; + } } }