Check MAX_RESAMPLER_PADDING properly to ensure it's large enough

This commit is contained in:
Chris Robinson 2019-09-28 16:41:26 -07:00
parent 7783fa738c
commit 00250042c8
2 changed files with 4 additions and 4 deletions

View File

@ -82,6 +82,10 @@
#include "bsinc_inc.h" #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 { namespace {
using namespace std::placeholders; using namespace std::placeholders;

View File

@ -66,10 +66,6 @@
static_assert((INT_MAX>>FRACTIONBITS)/MAX_PITCH > BUFFERSIZE, static_assert((INT_MAX>>FRACTIONBITS)/MAX_PITCH > BUFFERSIZE,
"MAX_PITCH and/or BUFFERSIZE are too large for FRACTIONBITS!"); "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}; Resampler ResamplerDefault{Resampler::Linear};