decoder/adplug: move the buffer into the loop

This commit is contained in:
Max Kellermann 2014-09-21 13:20:30 +02:00
parent ead034e638
commit 5d89aa06f7

View File

@ -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),