From 00250042c819b5900e1ff3bd03285cffebd93464 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 28 Sep 2019 16:41:26 -0700 Subject: [PATCH] Check MAX_RESAMPLER_PADDING properly to ensure it's large enough --- alc/alu.cpp | 4 ++++ alc/mixvoice.cpp | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/alc/alu.cpp b/alc/alu.cpp index 4e9bf9e0..21eea1db 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -82,6 +82,10 @@ #include "bsinc_inc.h" +static_assert(!(MAX_RESAMPLER_PADDING&1) && MAX_RESAMPLER_PADDING >= bsinc24.m[0], + "MAX_RESAMPLER_PADDING is not a multiple of two, or is too small"); + + namespace { using namespace std::placeholders; diff --git a/alc/mixvoice.cpp b/alc/mixvoice.cpp index b701a826..c696f114 100644 --- a/alc/mixvoice.cpp +++ b/alc/mixvoice.cpp @@ -66,10 +66,6 @@ static_assert((INT_MAX>>FRACTIONBITS)/MAX_PITCH > BUFFERSIZE, "MAX_PITCH and/or BUFFERSIZE are too large for FRACTIONBITS!"); -/* BSinc24 requires up to 23 extra samples before the current position, and 24 after. */ -static_assert(!(MAX_RESAMPLER_PADDING&1) && MAX_RESAMPLER_PADDING >= 48, - "MAX_RESAMPLER_PADDING must be a multiple of two and at least 48!"); - Resampler ResamplerDefault{Resampler::Linear};