aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-10-01 01:05:08 -0700
committerChris Robinson <[email protected]>2015-10-01 01:05:08 -0700
commit0fcd497796639a8af916dcfb0c61c67c1e76c6aa (patch)
tree9296c843bd6b0bbe840a5619bc6bc636d590d38e /Alc/mixer.c
parent07f80eb4e1ba0839ae97fac0914855c239c4ea1f (diff)
Combine two arrays
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 27d8cbcf..b3ea0933 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -57,17 +57,15 @@ enum Resampler {
static enum Resampler DefaultResampler = LinearResampler;
-static const ALsizei ResamplerPadding[ResamplerMax] = {
- 0, /* Point */
- 1, /* Linear */
- 2, /* FIR4 */
- 3, /* FIR6 */
-};
-static const ALsizei ResamplerPrePadding[ResamplerMax] = {
- 0, /* Point */
- 0, /* Linear */
- 1, /* FIR4 */
- 2, /* FIR6 */
+/* Each entry is a pair, where the first is the number of samples needed before
+ * the current position, and the second is the number of samples needed after
+ * (not including) the current position, for the given resampler.
+ */
+static const ALsizei ResamplerPadding[ResamplerMax][2] = {
+ {0, 0}, /* Point */
+ {0, 1}, /* Linear */
+ {1, 2}, /* FIR4 */
+ {2, 3}, /* FIR6 */
};
@@ -334,8 +332,8 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
OutPos = 0;
do {
- const ALuint BufferPrePadding = ResamplerPrePadding[DefaultResampler];
- const ALuint BufferPadding = ResamplerPadding[DefaultResampler];
+ const ALuint BufferPrePadding = ResamplerPadding[DefaultResampler][0];
+ const ALuint BufferPadding = ResamplerPadding[DefaultResampler][1];
ALuint SrcBufferSize, DstBufferSize;
/* Figure out how many buffer samples will be needed */