Added a maxBlockSize at 8192

This commit is contained in:
Paul Ferrand 2019-12-17 22:48:06 +01:00
parent 3f02f46213
commit 7ea5f4611c
2 changed files with 3 additions and 0 deletions

View file

@ -34,6 +34,7 @@ enum Oversampling {
namespace config {
constexpr float defaultSampleRate { 48000 };
constexpr int defaultSamplesPerBlock { 1024 };
constexpr int maxBlockSize { 8192 };
constexpr int preloadSize { 8192 };
constexpr int numChannels { 2 };
constexpr int numBackgroundThreads { 4 };

View file

@ -329,6 +329,8 @@ void sfz::Synth::garbageCollect() noexcept
void sfz::Synth::setSamplesPerBlock(int samplesPerBlock) noexcept
{
ASSERT(samplesPerBlock < config::maxBlockSize);
AtomicDisabler callbackDisabler { canEnterCallback };
while (inCallback) {