From cd983245f1967e04f833acc0ec27aefa94f061b0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 19 May 2014 05:46:01 -0700 Subject: Return a sample pointer from resamplers Both resampling and filtering now avoid copying samples when they no-op. --- OpenAL32/Include/alMain.h | 7 ++++--- OpenAL32/Include/alu.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 2f1eb850..63787251 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -677,9 +677,10 @@ struct ALCdevice_struct ALuint64 ClockBase; ALuint SamplesDone; - /* Temp storage used for mixing. */ - alignas(16) ALfloat SampleData1[BUFFERSIZE]; - alignas(16) ALfloat SampleData2[BUFFERSIZE]; + /* Temp storage used for each source when mixing. */ + alignas(16) ALfloat SourceData[BUFFERSIZE]; + alignas(16) ALfloat ResampledData[BUFFERSIZE]; + alignas(16) ALfloat FilteredData[BUFFERSIZE]; // Dry path buffer mix alignas(16) ALfloat DryBuffer[MaxChannels][BUFFERSIZE]; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 7fdb75cc..df0e923d 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -120,8 +120,8 @@ typedef struct SendParams { } SendParams; -typedef void (*ResamplerFunc)(const ALfloat *src, ALuint frac, ALuint increment, - ALfloat *restrict dst, ALuint dstlen); +typedef const ALfloat* (*ResamplerFunc)(const ALfloat *src, ALuint frac, ALuint increment, + ALfloat *restrict dst, ALuint dstlen); typedef void (*DryMixerFunc)(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data, MixGains *Gains, ALuint Counter, ALuint OutPos, -- cgit v1.2.3