From 94884ed04b88697acd851f1b4ab492221b809ad6 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 23 Jul 2013 00:13:15 -0700 Subject: Use a separate value for the maximum buffer channels Unlike the device, input buffers are accessed based on channel numbers instead of enums. This means the maximum number of channels they hold depends on the number of channels any one format can have, rather than the total number of recognized channels. Currently, this is 8 for 7.1. --- OpenAL32/alBuffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenAL32/alBuffer.c') diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index 44eacaff..d12fe80a 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -1087,8 +1087,8 @@ static ALalaw EncodeALaw(ALshort val) static void DecodeIMA4Block(ALshort *dst, const ALima4 *src, ALint numchans) { - ALint sample[MaxChannels], index[MaxChannels]; - ALuint code[MaxChannels]; + ALint sample[MAX_INPUT_CHANNELS], index[MAX_INPUT_CHANNELS]; + ALuint code[MAX_INPUT_CHANNELS]; ALsizei j,k,c; for(c = 0;c < numchans;c++) @@ -1749,7 +1749,7 @@ DECL_TEMPLATE(ALubyte3, ALubyte3) static void Convert_##T##_ALima4(T *dst, const ALima4 *src, ALuint numchans, \ ALuint len) \ { \ - ALshort tmp[65*MaxChannels]; /* Max samples an IMA4 frame can be */ \ + ALshort tmp[65*MAX_INPUT_CHANNELS]; /* Max samples an IMA4 frame can be */\ ALuint i, j, k; \ \ i = 0; \ @@ -1785,7 +1785,7 @@ DECL_TEMPLATE(ALubyte3) static void Convert_ALima4_##T(ALima4 *dst, const T *src, ALuint numchans, \ ALuint len) \ { \ - ALshort tmp[65*MaxChannels]; /* Max samples an IMA4 frame can be */ \ + ALshort tmp[65*MAX_INPUT_CHANNELS]; /* Max samples an IMA4 frame can be */\ ALint sample[MaxChannels] = {0,0,0,0,0,0,0,0}; \ ALint index[MaxChannels] = {0,0,0,0,0,0,0,0}; \ ALuint i, j; \ -- cgit v1.2.3