From 43cac64c42ded8fa5f32f5f106cd1bf30f051011 Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 10 Aug 2014 21:04:02 +0100 Subject: [PATCH] Fixed a minor typo in VST3 hosting. --- .../format_types/juce_VST3PluginFormat.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 29c28e03ab..efb75b59b8 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -428,16 +428,11 @@ public: if (hasFlag (flags, Vst::kIoChanged)) { - double sampleRate = owner->getSampleRate(); - int numSamples = owner->getBlockSize(); + const double sampleRate = owner->getSampleRate(); + const int blockSize = owner->getBlockSize(); - if (sampleRate <= 8000.0) - sampleRate = 44100.0; - - if (numSamples <= 0) - numSamples = 1024; - - owner->prepareToPlay (owner->getSampleRate(), owner->getBlockSize()); + owner->prepareToPlay (sampleRate >= 8000 ? sampleRate : 44100.0, + blockSize > 0 ? blockSize : 1024); } if (hasFlag (flags, Vst::kLatencyChanged))