diff options
author | Robin Gareus <robin@gareus.org> | 2014-10-07 21:45:46 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-10-07 21:48:04 +0200 |
commit | 118adc286bbf881a07e192907598220aa23a11cc (patch) | |
tree | a2cae211e22a8573103c2062159c7e368292669c /libs/ardour/lv2_plugin.cc | |
parent | ce818efe37a1e8a68789a9eb8124fd828b672dd7 (diff) |
fix crashes for plugin using maxBlockLength during latency compute.
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index b32d61dbc2..fe214e9659 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -1895,8 +1895,9 @@ LV2Plugin::latency_compute_run() uint32_t in_index = 0; uint32_t out_index = 0; - const framecnt_t bufsize = 1024; - float buffer[bufsize]; + // this is done in the main thread. non realtime. + const framecnt_t bufsize = _engine.samples_per_cycle(); + float *buffer = (float*) malloc(_engine.samples_per_cycle() * sizeof(float)); memset(buffer, 0, sizeof(float) * bufsize); @@ -1922,6 +1923,7 @@ LV2Plugin::latency_compute_run() if (was_activated) { activate(); } + free(buffer); } const LilvPort* |