aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--OpenAL32/alBuffer.c20
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: {