From ec8997b058fcf26b6f8dab1f1394ac0fb60ce1df Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 25 Dec 2013 22:37:16 +0000 Subject: [PATCH] Detect when LV2 host doesn't provide maxBufferLength option --- distrho/src/DistrhoPluginLV2.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/distrho/src/DistrhoPluginLV2.cpp b/distrho/src/DistrhoPluginLV2.cpp index bcdab966..be5275ed 100644 --- a/distrho/src/DistrhoPluginLV2.cpp +++ b/distrho/src/DistrhoPluginLV2.cpp @@ -38,7 +38,7 @@ #endif #if DISTRHO_PLUGIN_WANT_STATE -# warning LV2 State still TODO +# warning LV2 State still TODO (needs final testing) #endif #if DISTRHO_PLUGIN_WANT_TIMEPOS # warning LV2 TimePos still TODO @@ -563,6 +563,8 @@ static LV2_Handle lv2_instantiate(const LV2_Descriptor*, double sampleRate, cons } #endif + d_lastBufferSize = 0; + for (int i=0; options[i].key != 0; ++i) { if (options[i].key == uridMap->map(uridMap->handle, LV2_BUF_SIZE__maxBlockLength)) @@ -577,7 +579,10 @@ static LV2_Handle lv2_instantiate(const LV2_Descriptor*, double sampleRate, cons } if (d_lastBufferSize == 0) + { + d_stderr("Host does not provide maxBlockLength option"); d_lastBufferSize = 2048; + } d_lastSampleRate = sampleRate;