diff options
author | Chris Robinson <[email protected]> | 2019-02-24 16:13:51 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-02-24 16:13:51 -0800 |
commit | cadff0f6c17dc4055f972b434c9a9f8bdbf330f3 (patch) | |
tree | df1cb40100038d5a7334ed40c5d981340f19c593 /OpenAL32 | |
parent | a2ba550ebf8b837826d0b56d69386174bb4086c2 (diff) |
Reduce BUFFERSIZE to match the default period size
Also adds a bit more space to the temp source data buffer, to avoid needing to
loop on matching sample rates.
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 11 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index b696d7d9..f5d25926 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -547,7 +547,13 @@ struct BFChannelConfig { * to be a sensible size, however, as it constrains the max stepping value used * for mixing, as well as the maximum number of samples per mixing iteration. */ -#define BUFFERSIZE 2048 +#define BUFFERSIZE 1024 + +/* Maximum number of samples to pad on either end of a buffer for resampling. + * Note that both the beginning and end need padding! + */ +#define MAX_RESAMPLE_PADDING 24 + struct MixParams { /* Coefficient channel mapping for mixing to the buffer. */ @@ -632,7 +638,8 @@ struct ALCdevice { std::chrono::nanoseconds FixedLatency{0}; /* Temp storage used for mixer processing. */ - alignas(16) ALfloat TempBuffer[4][BUFFERSIZE]; + alignas(16) ALfloat SourceData[BUFFERSIZE + MAX_RESAMPLE_PADDING*2]; + alignas(16) ALfloat TempBuffer[3][BUFFERSIZE]; /* Mixing buffer used by the Dry mix, FOAOut, and Real out. */ al::vector<std::array<ALfloat,BUFFERSIZE>, 16> MixBuffer; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 6713c490..13362dea 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -31,11 +31,6 @@ enum class DistanceModel; #define MAX_PITCH 255 #define MAX_SENDS 16 -/* Maximum number of samples to pad on either end of a buffer for resampling. - * Note that both the beginning and end need padding! - */ -#define MAX_RESAMPLE_PADDING 24 - struct BSincTable; struct ALsource; |