diff --git a/include/debug.h b/include/debug.h index beec1c79f56..966d908ab46 100644 --- a/include/debug.h +++ b/include/debug.h @@ -32,8 +32,10 @@ // additional range-checkings) should be compiled #ifdef LMMS_DEBUG +#define LADSPA_DEBUG TRUE #include #else +#define LADSPA_DEBUG FALSE #define assert(x) ((void)(x)) #endif #include diff --git a/plugins/LadspaEffect/LadspaEffect.cpp b/plugins/LadspaEffect/LadspaEffect.cpp index 5fb89df2d8f..fddfb3d86e7 100644 --- a/plugins/LadspaEffect/LadspaEffect.cpp +++ b/plugins/LadspaEffect/LadspaEffect.cpp @@ -24,8 +24,10 @@ */ +#include #include +#include "debug.h" #include "LadspaEffect.h" #include "DataFile.h" #include "AudioDevice.h" @@ -241,6 +243,15 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, for( fpp_t frame = 0; frame < frames; ++frame ) { + if ( LADSPA_DEBUG && + ( isnan( pp->buffer[frame] ) || + isinf( pp->buffer[frame] ) ) ) + { + qDebug() << "name: " << m_descriptor->Label; + assert( ! isnan( pp->buffer[frame] ) ); + assert( ! isinf( pp->buffer[frame] ) ); + } + _buf[frame][channel] = d * _buf[frame][channel] + w * pp->buffer[frame]; out_sum += _buf[frame][channel] * _buf[frame][channel]; } diff --git a/plugins/LadspaEffect/swh/dyson_compress_1403.c b/plugins/LadspaEffect/swh/dyson_compress_1403.c index 25e0b7d64cc..0e3d3e77a1e 100644 --- a/plugins/LadspaEffect/swh/dyson_compress_1403.c +++ b/plugins/LadspaEffect/swh/dyson_compress_1403.c @@ -14,6 +14,7 @@ #define __USE_ISOC9X 1 #include +#include #include "ladspa.h" @@ -836,7 +837,7 @@ static void __attribute__((constructor)) swh_init() { D_("Release time (s)"); port_range_hints[DYSONCOMPRESS_RELEASE_TIME].HintDescriptor = LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_LOW; - port_range_hints[DYSONCOMPRESS_RELEASE_TIME].LowerBound = 0; + port_range_hints[DYSONCOMPRESS_RELEASE_TIME].LowerBound = FLT_MIN; port_range_hints[DYSONCOMPRESS_RELEASE_TIME].UpperBound = 1; /* Parameters for Fast compression ratio */ diff --git a/plugins/LadspaEffect/swh/shaper_1187.c b/plugins/LadspaEffect/swh/shaper_1187.c index c1a52906bf7..7adfb3abdf8 100644 --- a/plugins/LadspaEffect/swh/shaper_1187.c +++ b/plugins/LadspaEffect/swh/shaper_1187.c @@ -115,8 +115,8 @@ static void runShaper(LADSPA_Handle instance, unsigned long sample_count) { if (shapep < 1.0f && shapep > -1.0f) { shape = 1.0f; - } else if (shape < 0) { - shape = -1.0f / shape; + } else if (shapep < 0) { + shape = -1.0f / shapep; } else { shape = shapep; } @@ -160,8 +160,8 @@ static void runAddingShaper(LADSPA_Handle instance, unsigned long sample_count) if (shapep < 1.0f && shapep > -1.0f) { shape = 1.0f; - } else if (shape < 0) { - shape = -1.0f / shape; + } else if (shapep < 0) { + shape = -1.0f / shapep; } else { shape = shapep; }