Commit 4ed06354 authored by Max Kellermann's avatar Max Kellermann

DecoderInternal: simplify need_chunks()

Remove the "do_wait" parameter which is always true. Check only command==NONE and merge the "return" statements.
parent 1904e504
......@@ -42,19 +42,12 @@ Decoder::~Decoder()
* one.
*/
static DecoderCommand
need_chunks(DecoderControl &dc, bool do_wait)
need_chunks(DecoderControl &dc)
{
if (dc.command == DecoderCommand::STOP ||
dc.command == DecoderCommand::SEEK)
return dc.command;
if (do_wait) {
if (dc.command == DecoderCommand::NONE)
dc.Wait();
return dc.command;
}
return DecoderCommand::NONE;
return dc.command;
}
struct music_chunk *
......@@ -79,7 +72,7 @@ decoder_get_chunk(Decoder &decoder)
}
dc.Lock();
cmd = need_chunks(dc, true);
cmd = need_chunks(dc);
dc.Unlock();
} while (cmd == DecoderCommand::NONE);
......
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