mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
LV2 Client: Ensure AudioBuffer size matches numSteps during run
This commit is contained in:
parent
6296313d79
commit
a8162d124b
1 changed files with 5 additions and 1 deletions
|
|
@ -505,8 +505,12 @@ public:
|
|||
|
||||
void run (uint32_t numSteps)
|
||||
{
|
||||
// If this is hit, the host is trying to process more samples than it told us to prepare
|
||||
jassert (static_cast<int> (numSteps) <= processor->getBlockSize());
|
||||
|
||||
midi.clear();
|
||||
playHead.invalidate();
|
||||
audio.setSize (audio.getNumChannels(), static_cast<int> (numSteps), true, false, true);
|
||||
|
||||
ports.forEachInputEvent ([&] (const LV2_Atom_Event* event)
|
||||
{
|
||||
|
|
@ -536,7 +540,7 @@ public:
|
|||
processor->setNonRealtime (ports.isFreeWheeling());
|
||||
|
||||
for (auto i = 0, end = processor->getTotalNumInputChannels(); i < end; ++i)
|
||||
audio.copyFrom (i, 0, ports.getBufferForAudioInput (i), (int) numSteps);
|
||||
audio.copyFrom (i, 0, ports.getBufferForAudioInput (i), audio.getNumSamples());
|
||||
|
||||
jassert (countNaNs (audio) == 0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue