From e77444451ec6447984c1847d5097e45f1d4788f3 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Fri, 30 Apr 2021 00:55:33 +0200 Subject: [PATCH] pd: voices should always lock --- plugins/puredata/sfizz_puredata.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/puredata/sfizz_puredata.c b/plugins/puredata/sfizz_puredata.c index f1aafe69..8637ecc6 100644 --- a/plugins/puredata/sfizz_puredata.c +++ b/plugins/puredata/sfizz_puredata.c @@ -230,13 +230,13 @@ static void sfizz_tilde_hdcc(t_sfizz_tilde* self, t_float cc, t_float value) static void sfizz_tilde_voices(t_sfizz_tilde* self, t_float value) { - if (spin_mutex_trylock(self->mutex)) { - int numvoices = (int)value; - if (numvoices < 1) - numvoices = 1; - sfizz_set_num_voices(self->synth, numvoices); - spin_mutex_unlock(self->mutex); - } + int numvoices = (int)value; + if (numvoices < 1) + numvoices = 1; + + spin_mutex_lock(self->mutex); + sfizz_set_num_voices(self->synth, numvoices); + spin_mutex_unlock(self->mutex); } #if defined(_WIN32)