DecoderInternal: simplify need_chunks()

Remove the "do_wait" parameter which is always true.  Check only
command==NONE and merge the "return" statements.
This commit is contained in:
Max Kellermann 2013-11-08 11:59:56 +01:00
parent 1904e504be
commit 4ed0635447

View File

@ -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)
} }
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);