From 893a9b312d23338acade840363fac18267f9f6b9 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Wed, 13 May 2020 23:28:21 +0200 Subject: [PATCH] Simplify the checks --- lv2/sfizz.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lv2/sfizz.c b/lv2/sfizz.c index 3715cab7..89529d09 100644 --- a/lv2/sfizz.c +++ b/lv2/sfizz.c @@ -553,13 +553,11 @@ static int next_pow_2(int v) static void sfizz_lv2_check_oversampling(sfizz_plugin_t* self) { - if (*self->oversampling_port < 0) - return; - - int port_value = (int)*self->oversampling_port; + int port_value = next_pow_2((int)*self->oversampling_port); if (port_value == (int)self->oversampling) return; - self->oversampling = (sfizz_oversampling_factor_t)next_pow_2(port_value); + + self->oversampling = (sfizz_oversampling_factor_t)port_value; LV2_Atom_Int atom = { .atom.type = self->sfizz_oversampling_uri,