aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-23 13:55:52 +0200
committerMax Kellermann <max@duempel.org>2014-08-23 13:55:52 +0200
commitb1fb09e18366040b5e17b100cd8469933acddbef (patch)
treecf0201ad797d94101ce30037e70934e9ea13ab3c
parentcd0082c630bde38ef975da6ef463c8869c27df3b (diff)
downloadmpd-b1fb09e18366040b5e17b100cd8469933acddbef.tar.gz
mpd-b1fb09e18366040b5e17b100cd8469933acddbef.tar.xz
mpd-b1fb09e18366040b5e17b100cd8469933acddbef.zip
decoder/dsf: make the buffer more local
This allows the compiler to discard buffer contents between two iterations.
-rw-r--r--src/decoder/plugins/DsfDecoderPlugin.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/decoder/plugins/DsfDecoderPlugin.cxx b/src/decoder/plugins/DsfDecoderPlugin.cxx
index c0b0871cf..3b967fc14 100644
--- a/src/decoder/plugins/DsfDecoderPlugin.cxx
+++ b/src/decoder/plugins/DsfDecoderPlugin.cxx
@@ -252,12 +252,11 @@ dsf_decode_chunk(Decoder &decoder, InputStream &is,
offset_type n_blocks,
bool bitreverse)
{
- /* worst-case buffer size */
- uint8_t buffer[MAX_CHANNELS * DSF_BLOCK_SIZE];
-
const size_t block_size = channels * DSF_BLOCK_SIZE;
for (offset_type i = 0; i < n_blocks;) {
+ /* worst-case buffer size */
+ uint8_t buffer[MAX_CHANNELS * DSF_BLOCK_SIZE];
if (!decoder_read_full(&decoder, is, buffer, block_size))
return false;