summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2022-12-12 14:17:56 +1100
committerDamien Zammit <damien@zamaudio.com>2022-12-12 14:17:56 +1100
commitfdb08e59cf85f7decfc495678febc4fc81850f97 (patch)
tree71dec75cb4fccc1f70c38a609e95a07df88d6353
parentfea4bf48308b9b8a9b8a98b04935957bdd54aacf (diff)
Fix crash in convolution based plugins
-rw-r--r--plugins/ZamHeadX2/ZamHeadX2Plugin.cpp2
-rw-r--r--plugins/ZamHeadX2/convolution.cpp5
-rw-r--r--plugins/ZamVerb/ZamVerbPlugin.cpp2
-rw-r--r--plugins/ZamVerb/convolution.cpp5
4 files changed, 6 insertions, 8 deletions
diff --git a/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp b/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp
index c74a069..ac7b698 100644
--- a/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp
+++ b/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp
@@ -209,10 +209,12 @@ void ZamHeadX2Plugin::setState(const char* key, const char*)
snprintf(azim, 3, "%d", az);
if ((az != azold) || (el != elold)) {
other = !active;
+ signal = false;
clv[other]->clv_release();
clv[other]->clv_configure("convolution.ir.preset", elev, azim);
clv[other]->clv_initialize(getSampleRate(), 2, 2, getBufferSize());
swap = other;
+ signal = true;
}
azold = az;
elold = el;
diff --git a/plugins/ZamHeadX2/convolution.cpp b/plugins/ZamHeadX2/convolution.cpp
index 8f21269..a3e3f33 100644
--- a/plugins/ZamHeadX2/convolution.cpp
+++ b/plugins/ZamHeadX2/convolution.cpp
@@ -448,7 +448,7 @@ void LV2convolv::clv_release (void) {
void LV2convolv::clv_clone_settings(LV2convolv *clv_new) {
convproc = clv_new->convproc;
- ir_fn = clv_new->ir_fn;
+ ir_fn = strdup(clv_new->ir_fn);
ir_preset = clv_new->ir_preset;
ir_presetx = clv_new->ir_presetx;
ir_presety = clv_new->ir_presety;
@@ -462,9 +462,6 @@ void LV2convolv::clv_clone_settings(LV2convolv *clv_new) {
fragment_size = clv_new->fragment_size;
clv_new->convproc = NULL;
- if (ir_fn) {
- clv_new->ir_fn = strdup (ir_fn);
- }
}
void LV2convolv::clv_free (void) {
diff --git a/plugins/ZamVerb/ZamVerbPlugin.cpp b/plugins/ZamVerb/ZamVerbPlugin.cpp
index d4235f8..8e777b0 100644
--- a/plugins/ZamVerb/ZamVerbPlugin.cpp
+++ b/plugins/ZamVerb/ZamVerbPlugin.cpp
@@ -193,10 +193,12 @@ void ZamVerbPlugin::setState(const char* key, const char*)
if (strcmp(key, "reload") == 0) {
snprintf(preset, 2, "%d", (int)room);
other = !active;
+ signal = false;
clv[other]->clv_release();
clv[other]->clv_configure("convolution.ir.preset", preset);
clv[other]->clv_initialize(getSampleRate(), 2, 2, getBufferSize());
swap = other;
+ signal = true;
}
}
diff --git a/plugins/ZamVerb/convolution.cpp b/plugins/ZamVerb/convolution.cpp
index 57f04b2..1ef44bc 100644
--- a/plugins/ZamVerb/convolution.cpp
+++ b/plugins/ZamVerb/convolution.cpp
@@ -140,7 +140,7 @@ void LV2convolv::clv_release (void) {
void LV2convolv::clv_clone_settings(LV2convolv *clv_new) {
convproc = clv_new->convproc;
- ir_fn = clv_new->ir_fn;
+ ir_fn = strdup(clv_new->ir_fn);
ir_preset = clv_new->ir_preset;
memcpy (chn_inp, clv_new->chn_inp, sizeof(chn_inp));
memcpy (chn_out, clv_new->chn_out, sizeof(chn_out));
@@ -152,9 +152,6 @@ void LV2convolv::clv_clone_settings(LV2convolv *clv_new) {
fragment_size = clv_new->fragment_size;
clv_new->convproc = NULL;
- if (ir_fn) {
- clv_new->ir_fn = strdup (ir_fn);
- }
}
void LV2convolv::clv_free (void) {