1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-22 01:34:21 +00:00

Adapt the max capacity of AudioFormatWriter::writeFromFloatArrays

Currently this operation is limited and asserts if the incoming audio buffer
has more than 255 channels. Since `chans` is a vector, it seems straightforward
to adapt its size and support any value of `numSourceChannels`. This will also
spare the creation of 256 int pointers when buffers of less than 255 channels
are written.
This commit is contained in:
j-bresson 2022-01-16 02:32:34 +01:00
parent 1fc0de32c8
commit d15fa8f0e3

View file

@ -157,7 +157,7 @@ bool AudioFormatWriter::writeFromFloatArrays (const float* const* channels, int
if (isFloatingPoint())
return write ((const int**) channels, numSamples);
std::vector<int*> chans (256);
std::vector<int*> chans (numSourceChannels + 1);
std::vector<int> scratch (4096);
jassert (numSourceChannels < (int) chans.size());