diff options
author | Max Kellermann <max@musicpd.org> | 2019-08-02 22:20:55 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-08-02 23:19:11 +0200 |
commit | 1d74a029a228be228b6d852d9eff028d709e1384 (patch) | |
tree | cae58d0af3ac3de390ee174fd2942d5550fc82e7 | |
parent | 6b8ca514bb3f327b3f23ffe4730657a93de53035 (diff) |
decoder/mad: simplify variable initialization in FillBuffer()
-rw-r--r-- | src/decoder/plugins/MadDecoderPlugin.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index 0facfc0ec..7d25121cc 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -223,18 +223,14 @@ MadDecoder::Seek(long offset) inline bool MadDecoder::FillBuffer() { - size_t remaining, length; - unsigned char *dest; + size_t remaining = 0, length = READ_BUFFER_SIZE; + unsigned char *dest = input_buffer; if (stream.next_frame != nullptr) { remaining = stream.bufend - stream.next_frame; memmove(input_buffer, stream.next_frame, remaining); - dest = input_buffer + remaining; - length = READ_BUFFER_SIZE - remaining; - } else { - remaining = 0; - length = READ_BUFFER_SIZE; - dest = input_buffer; + dest += remaining; + length -= remaining; } /* we've exhausted the read buffer, so give up!, these potential |