From 51abed9732f9b84723a96d64104f9707a40d2e45 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 3 Aug 2019 11:40:06 +0200 Subject: [PATCH] decoder/mad: pass mad_pcm to mad_fixed_to_24_buffer() --- src/decoder/plugins/MadDecoderPlugin.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index 083f7f978..5d3cb5fec 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -89,13 +89,13 @@ mad_fixed_to_24_sample(mad_fixed_t sample) noexcept } static void -mad_fixed_to_24_buffer(int32_t *dest, const struct mad_synth *synth, +mad_fixed_to_24_buffer(int32_t *dest, const struct mad_pcm &src, unsigned int start, unsigned int end, unsigned int num_channels) { for (unsigned i = start; i < end; ++i) for (unsigned c = 0; c < num_channels; ++c) - *dest++ = mad_fixed_to_24_sample(synth->pcm.samples[c][i]); + *dest++ = mad_fixed_to_24_sample(src.samples[c][i]); } static bool @@ -848,7 +848,7 @@ MadDecoder::SubmitPCM(unsigned i, unsigned pcm_length) noexcept { unsigned int num_samples = pcm_length - i; - mad_fixed_to_24_buffer(output_buffer, &synth, + mad_fixed_to_24_buffer(output_buffer, synth.pcm, i, i + num_samples, MAD_NCHANNELS(&frame.header)); num_samples *= MAD_NCHANNELS(&frame.header);