Browse Source

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.
pull/22/head
reuk 3 years ago
parent
commit
5b3aa7fc2d
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      modules/juce_audio_processors/format_types/juce_AU_Shared.h

+ 3
- 6
modules/juce_audio_processors/format_types/juce_AU_Shared.h View File

@@ -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…
Cancel
Save