From 9c46370234fe45437f0f64fab963a232cb3e9a46 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sat, 23 Sep 2023 00:00:02 +0200 Subject: [PATCH] Support LV2_BUF_SIZE__powerOf2BlockLength --- src/core/lv2/Lv2Manager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/lv2/Lv2Manager.cpp b/src/core/lv2/Lv2Manager.cpp index 9c62703e0..df6e5a7c1 100644 --- a/src/core/lv2/Lv2Manager.cpp +++ b/src/core/lv2/Lv2Manager.cpp @@ -35,6 +35,7 @@ #include #include +#include "AudioEngine.h" #include "Engine.h" #include "Plugin.h" #include "Lv2ControlBase.h" @@ -156,6 +157,10 @@ Lv2Manager::Lv2Manager() : m_supportedFeatureURIs.insert(LV2_BUF_SIZE__boundedBlockLength); // block length is only changed initially in AudioEngine CTOR m_supportedFeatureURIs.insert(LV2_BUF_SIZE__fixedBlockLength); + if (const auto fpp = Engine::audioEngine()->framesPerPeriod(); (fpp & (fpp - 1)) == 0) // <=> ffp is power of 2 (for ffp > 0) + { + m_supportedFeatureURIs.insert(LV2_BUF_SIZE__powerOf2BlockLength); + } auto supportOpt = [this](Lv2UridCache::Id id) {