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() ...@@ -42,19 +42,12 @@ Decoder::~Decoder()
* one. * one.
*/ */
static DecoderCommand static DecoderCommand
need_chunks(DecoderControl &dc, bool do_wait) need_chunks(DecoderControl &dc)
{ {
if (dc.command == DecoderCommand::STOP || if (dc.command == DecoderCommand::NONE)
dc.command == DecoderCommand::SEEK)
return dc.command;
if (do_wait) {
dc.Wait(); dc.Wait();
return dc.command; return dc.command;
}
return DecoderCommand::NONE;
} }
struct music_chunk * struct music_chunk *
...@@ -79,7 +72,7 @@ decoder_get_chunk(Decoder &decoder) ...@@ -79,7 +72,7 @@ decoder_get_chunk(Decoder &decoder)
} }
dc.Lock(); dc.Lock();
cmd = need_chunks(dc, true); cmd = need_chunks(dc);
dc.Unlock(); dc.Unlock();
} while (cmd == DecoderCommand::NONE); } 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