diff options
author | Chris Robinson <[email protected]> | 2011-03-19 12:40:14 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-03-19 12:40:14 -0700 |
commit | d11593eb5c2bbf338b9f17acd40c2ab6390e737e (patch) | |
tree | 46e11b4127d32c2702c8ec486642d74e39e7b9a3 /OpenAL32/alBuffer.c | |
parent | 4bdedc7fde702ddffb035601dedca7d64ad05500 (diff) |
Use nested loops when converting data
Diffstat (limited to 'OpenAL32/alBuffer.c')
-rw-r--r-- | OpenAL32/alBuffer.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index 7472f4b8..32b620b1 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -1399,12 +1399,15 @@ static __inline ALmulaw Conv_ALmulaw_ALmulaw(ALmulaw val) #undef DECL_TEMPLATE #define DECL_TEMPLATE(T1, T2) \ -static void Convert_##T1##_##T2(T1 *dst, const T2 *src, ALuint chans, ALuint len)\ +static void Convert_##T1##_##T2(T1 *dst, const T2 *src, ALuint numchans, \ + ALuint len) \ { \ - ALuint i; \ - len *= chans; \ + ALuint i, j; \ for(i = 0;i < len;i++) \ - *(dst++) = Conv_##T1##_##T2(*(src++)); \ + { \ + for(j = 0;j < numchans;j++) \ + *(dst++) = Conv_##T1##_##T2(*(src++)); \ + } \ } DECL_TEMPLATE(ALbyte, ALbyte) |