From 5d89aa06f786e549f4db6591eaa2800f471f8868 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 21 Sep 2014 13:20:30 +0200 Subject: decoder/adplug: move the buffer into the loop --- src/decoder/plugins/AdPlugDecoderPlugin.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/decoder/plugins/AdPlugDecoderPlugin.cxx b/src/decoder/plugins/AdPlugDecoderPlugin.cxx index 2d7ce696e..7551f92c2 100644 --- a/src/decoder/plugins/AdPlugDecoderPlugin.cxx +++ b/src/decoder/plugins/AdPlugDecoderPlugin.cxx @@ -64,14 +64,14 @@ adplug_file_decode(Decoder &decoder, Path path_fs) decoder_initialized(decoder, audio_format, false, SongTime::FromMS(player->songlength())); - int16_t buffer[2048]; - const unsigned frames_per_buffer = ARRAY_SIZE(buffer) / 2; DecoderCommand cmd; do { if (!player->update()) break; + int16_t buffer[2048]; + constexpr unsigned frames_per_buffer = ARRAY_SIZE(buffer) / 2; opl.update(buffer, frames_per_buffer); cmd = decoder_data(decoder, nullptr, buffer, sizeof(buffer), -- cgit v1.2.3