diff options
author | Max Kellermann <max@duempel.org> | 2013-11-08 11:59:56 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-11-08 11:59:56 +0100 |
commit | 4ed06354474141059db90a2aa6dab1edcebdd78c (patch) | |
tree | 0c54c3c6eeb9102cf91e927567859bda1435bdbc /src/DecoderInternal.cxx | |
parent | 1904e504be70f16902009509581daa25c70fcaf1 (diff) | |
download | mpd-4ed06354474141059db90a2aa6dab1edcebdd78c.tar.gz mpd-4ed06354474141059db90a2aa6dab1edcebdd78c.tar.xz mpd-4ed06354474141059db90a2aa6dab1edcebdd78c.zip |
DecoderInternal: simplify need_chunks()
Remove the "do_wait" parameter which is always true. Check only
command==NONE and merge the "return" statements.
Diffstat (limited to 'src/DecoderInternal.cxx')
-rw-r--r-- | src/DecoderInternal.cxx | 15 |
1 files 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); |