Skip to content
Snippets Groups Projects
Commit f388aade authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #28679: audio: use correctly sized buffer for resampling

parent 63a40673
No related branches found
No related tags found
No related merge requests found
......@@ -101,9 +101,8 @@ void SamplerateConverter::resample(const AudioBuffer &dataIn, AudioBuffer &dataO
/*
TODO: one-shot deinterleave and float-to-short conversion
currently using floatBufferIn_ as scratch
*/
SFLAudioSample *scratch_buff = reinterpret_cast<SFLAudioSample *>(floatBufferIn_.data());
src_float_to_short_array(floatBufferOut_.data(), scratch_buff, outSamples);
dataOut.deinterleave(scratch_buff, src_data.output_frames, nbChans);
std::vector<SFLAudioSample> scratch_buff(outSamples);
src_float_to_short_array(floatBufferOut_.data(), scratch_buff.data(), outSamples);
dataOut.deinterleave(scratch_buff.data(), src_data.output_frames, nbChans);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment