mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-20 01:14:20 +00:00
AU Client: Ensure processBlock receives AudioBuffer of correct size
fc378aaf9a introduced a regression where
plugins with no audio channels (such as MIDI FX plugins) would receive
an audio buffer with a length-in-samples of '0', rather than the actual
block length.
This commit is contained in:
parent
88b5f0dc95
commit
5b3aa7fc2d
1 changed files with 3 additions and 6 deletions
|
|
@ -157,13 +157,10 @@ struct AudioUnitHelpers
|
|||
|
||||
AudioBuffer<float>& getBuffer (UInt32 frames) noexcept
|
||||
{
|
||||
#if JUCE_DEBUG
|
||||
for (int i = 0; i < (int) channels.size(); ++i)
|
||||
jassert (channels[(size_t) i] != nullptr);
|
||||
#endif
|
||||
jassert (std::none_of (channels.begin(), channels.end(), [] (auto* x) { return x == nullptr; }));
|
||||
|
||||
if (! channels.empty())
|
||||
mutableBuffer.setDataToReferTo (channels.data(), (int) channels.size(), static_cast<int> (frames));
|
||||
const auto channelPtr = channels.empty() ? scratch.getArrayOfWritePointers() : channels.data();
|
||||
mutableBuffer.setDataToReferTo (channelPtr, (int) channels.size(), static_cast<int> (frames));
|
||||
|
||||
return mutableBuffer;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue