DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit ec8997b058fcf26b6f8dab1f1394ac0fb60ce1df
parent 8aad566744c5f26663510ddeaf2dea4b2db63a60
Author: falkTX <falktx@gmail.com>
Date:   Wed, 25 Dec 2013 22:36:51 +0000

Detect when LV2 host doesn't provide maxBufferLength option

Diffstat:
Mdistrho/src/DistrhoPluginLV2.cpp | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 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;