Commit 7f3be96e authored by Max Kellermann's avatar Max Kellermann

decoder_api: always notify_wait() for free chunks

One of the previous patches made MPD consume 100% CPU in a busy wait: when the music_pipe was full, it did not wait (with notify_wait()) for free chunks, because a variable has a different meaning now. Always pass "true" as the "wait" parameter.
parent 5395f5f6
...@@ -243,8 +243,7 @@ decoder_data(struct decoder *decoder, ...@@ -243,8 +243,7 @@ decoder_data(struct decoder *decoder,
if (dest == NULL) { if (dest == NULL) {
/* the music pipe is full: wait for more /* the music pipe is full: wait for more
room */ room */
enum decoder_command cmd = enum decoder_command cmd = need_chunks(is, true);
need_chunks(is, nbytes == 0);
if (cmd != DECODE_COMMAND_NONE) if (cmd != DECODE_COMMAND_NONE)
return cmd; return cmd;
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