Browse Source

Fixed an issue in the AAX wrapper where scrubbing in ProTools caused spurious calls to prepareToPlay() from JuceAAX_Processor::process().

tags/2021-05-28
Timur Doumler 10 years ago
parent
commit
16cfead473
1 changed files with 14 additions and 3 deletions
  1. +14
    -3
      modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp

+ 14
- 3
modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp View File

@@ -429,7 +429,7 @@ struct AAXClasses
public AudioProcessorListener
{
public:
JuceAAX_Processor() : sampleRate (0), lastBufferSize (1024)
JuceAAX_Processor() : sampleRate (0), lastBufferSize (1024), maxBufferSize (1024)
{
pluginInstance = createPluginFilterOfType (AudioProcessor::wrapperType_AAX);
pluginInstance->setPlayHead (this);
@@ -858,7 +858,17 @@ struct AAXClasses
pluginInstance->setPlayConfigDetails (pluginInstance->getNumInputChannels(),
pluginInstance->getNumOutputChannels(),
sampleRate, bufferSize);
pluginInstance->prepareToPlay (sampleRate, bufferSize);
if (bufferSize > maxBufferSize)
{
// we only call prepareToPlay here if the new buffer size is larger than
// the one used last time prepareToPlay was called.
// currently, this should never actually happen, because as of Pro Tools 12,
// the maximum possible value is 1024, and we call prepareToPlay with that
// value during initialisation.
pluginInstance->prepareToPlay (sampleRate, bufferSize);
maxBufferSize = bufferSize;
}
}
const ScopedLock sl (pluginInstance->getCallbackLock());
@@ -962,6 +972,7 @@ struct AAXClasses
audioProcessor.setPlayConfigDetails (numberOfInputChannels, numberOfOutputChannels, sampleRate, lastBufferSize);
audioProcessor.prepareToPlay (sampleRate, lastBufferSize);
maxBufferSize = lastBufferSize;
check (Controller()->SetSignalLatency (audioProcessor.getLatencySamples()));
}
@@ -973,7 +984,7 @@ struct AAXClasses
Array<float*> channelList;
int32_t juceChunkIndex;
AAX_CSampleRate sampleRate;
int lastBufferSize;
int lastBufferSize, maxBufferSize;
struct ChunkMemoryBlock : public ReferenceCountedObject
{


Loading…
Cancel
Save