Browse Source

Detect when LV2 host doesn't provide maxBufferLength option

gh-pages
falkTX 11 years ago
parent
commit
ec8997b058
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      distrho/src/DistrhoPluginLV2.cpp

+ 6
- 1
distrho/src/DistrhoPluginLV2.cpp View File

@@ -38,7 +38,7 @@
#endif #endif


#if DISTRHO_PLUGIN_WANT_STATE #if DISTRHO_PLUGIN_WANT_STATE
# warning LV2 State still TODO
# warning LV2 State still TODO (needs final testing)
#endif #endif
#if DISTRHO_PLUGIN_WANT_TIMEPOS #if DISTRHO_PLUGIN_WANT_TIMEPOS
# warning LV2 TimePos still TODO # warning LV2 TimePos still TODO
@@ -563,6 +563,8 @@ static LV2_Handle lv2_instantiate(const LV2_Descriptor*, double sampleRate, cons
} }
#endif #endif


d_lastBufferSize = 0;

for (int i=0; options[i].key != 0; ++i) for (int i=0; options[i].key != 0; ++i)
{ {
if (options[i].key == uridMap->map(uridMap->handle, LV2_BUF_SIZE__maxBlockLength)) 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) if (d_lastBufferSize == 0)
{
d_stderr("Host does not provide maxBlockLength option");
d_lastBufferSize = 2048; d_lastBufferSize = 2048;
}


d_lastSampleRate = sampleRate; d_lastSampleRate = sampleRate;




Loading…
Cancel
Save