From 4ed06354474141059db90a2aa6dab1edcebdd78c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 8 Nov 2013 11:59:56 +0100 Subject: [PATCH] DecoderInternal: simplify need_chunks() Remove the "do_wait" parameter which is always true. Check only command==NONE and merge the "return" statements. --- src/DecoderInternal.cxx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/DecoderInternal.cxx b/src/DecoderInternal.cxx index 783150c08..d5f40ad48 100644 --- a/src/DecoderInternal.cxx +++ b/src/DecoderInternal.cxx @@ -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);