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:
parent
1904e504be
commit
4ed0635447
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user