From ddf28667c9f52f30573853c8177e77149829fa7c Mon Sep 17 00:00:00 2001 From: Olli Date: Tue, 17 Sep 2024 19:26:14 +0300 Subject: [PATCH] Increase max nr. of channels from 16 to 32 --- include/STTypes.h | 5 +++-- source/SoundTouch/FIRFilter.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/STTypes.h b/include/STTypes.h index 03dea9e..26e9af7 100644 --- a/include/STTypes.h +++ b/include/STTypes.h @@ -56,8 +56,9 @@ typedef unsigned long ulong; namespace soundtouch { - /// Max allowed number of channels - #define SOUNDTOUCH_MAX_CHANNELS 16 + /// Max allowed number of channels. This is not a hard limit but to have some + /// maximum value for argument sanity checks -- can be increased if necessary + #define SOUNDTOUCH_MAX_CHANNELS 32 /// Activate these undef's to overrule the possible sampletype /// setting inherited from some other header file: diff --git a/source/SoundTouch/FIRFilter.cpp b/source/SoundTouch/FIRFilter.cpp index 4cd330e..20f9311 100644 --- a/source/SoundTouch/FIRFilter.cpp +++ b/source/SoundTouch/FIRFilter.cpp @@ -155,7 +155,7 @@ uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uin assert(src != nullptr); assert(dest != nullptr); assert(filterCoeffs != nullptr); - assert(numChannels < 16); + assert(numChannels <= SOUNDTOUCH_MAX_CHANNELS); // hint compiler autovectorization that loop length is divisible by 8 int ilength = length & -8;