diff options
author | Chris Robinson <[email protected]> | 2010-11-30 00:32:13 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-11-30 00:32:13 -0800 |
commit | 018f9fc27841aa1922797a22d9bcc7aabe81e9f1 (patch) | |
tree | 7626f0be6ea820ba4119f2a8034643609faa23d4 /OpenAL32 | |
parent | c0f6d46cd8238d985711ff1b9c2efc7a20e4c0b7 (diff) |
Handle all channel configurations for double
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/alBuffer.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index bba92b21..bad6f85d 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -297,14 +297,22 @@ AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid alSetError(Context, err); break; - case SrcFmtDouble: - if(SrcChannels == SrcFmtMono) - err = LoadData(ALBuf, freq, AL_FORMAT_MONO_FLOAT32, size, SrcChannels, SrcType, data); - else - err = LoadData(ALBuf, freq, AL_FORMAT_STEREO_FLOAT32, size, SrcChannels, SrcType, data); + case SrcFmtDouble: { + ALenum NewFormat = AL_FORMAT_MONO_FLOAT32; + switch(SrcChannels) + { + case SrcFmtMono: NewFormat = AL_FORMAT_MONO_FLOAT32; break; + case SrcFmtStereo: NewFormat = AL_FORMAT_STEREO_FLOAT32; break; + case SrcFmtRear: NewFormat = AL_FORMAT_REAR32; break; + case SrcFmtQuad: NewFormat = AL_FORMAT_QUAD32; break; + case SrcFmtX51: NewFormat = AL_FORMAT_51CHN32; break; + case SrcFmtX61: NewFormat = AL_FORMAT_61CHN32; break; + case SrcFmtX71: NewFormat = AL_FORMAT_71CHN32; break; + } + err = LoadData(ALBuf, freq, NewFormat, size, SrcChannels, SrcType, data); if(err != AL_NO_ERROR) alSetError(Context, err); - break; + } break; case SrcFmtMulaw: case SrcFmtIMA4: { |