From a58501468eda4ecf2c12d61de03f0276dc19fefc Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 16 Jul 2020 15:37:02 +0100 Subject: [PATCH] Correct usage of LV2 options interface to change plugin block size Signed-off-by: falkTX --- source/backend/plugin/CarlaPluginLV2.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/source/backend/plugin/CarlaPluginLV2.cpp b/source/backend/plugin/CarlaPluginLV2.cpp index 0deb1b41a..7fc538e41 100644 --- a/source/backend/plugin/CarlaPluginLV2.cpp +++ b/source/backend/plugin/CarlaPluginLV2.cpp @@ -4608,11 +4608,20 @@ public: if (fExt.options != nullptr && fExt.options->set != nullptr) { - fExt.options->set(fHandle, &fLv2Options.opts[CarlaPluginLV2Options::MaxBlockLenth]); - fExt.options->set(fHandle, &fLv2Options.opts[CarlaPluginLV2Options::NominalBlockLenth]); + LV2_Options_Option options[2]; + carla_zeroStructs(options, 2); + + carla_copyStruct(options[0], fLv2Options.opts[CarlaPluginLV2Options::MaxBlockLenth]); + fExt.options->set(fHandle, options); + + carla_copyStruct(options[0], fLv2Options.opts[CarlaPluginLV2Options::NominalBlockLenth]); + fExt.options->set(fHandle, options); if (fLv2Options.minBufferSize != 1) - fExt.options->set(fHandle, &fLv2Options.opts[CarlaPluginLV2Options::MinBlockLenth]); + { + carla_copyStruct(options[0], fLv2Options.opts[CarlaPluginLV2Options::MinBlockLenth]); + fExt.options->set(fHandle, options); + } } }