aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-11-29 23:46:49 -0800
committerChris Robinson <[email protected]>2010-11-29 23:46:49 -0800
commit04df919a1c33f700740630199d5f5d80d0466177 (patch)
treece43f4f2d6a19702e963069111c9224db4c3c761
parentf82e628f08a0d6d259fc78f998db035413dee04b (diff)
Clean up muLaw format loading a bit
-rw-r--r--OpenAL32/alBuffer.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 47555b82..aefb6076 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -307,23 +307,22 @@ AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid
alSetError(Context, err);
break;
- case SrcFmtMulaw:
- if(SrcChannels == SrcFmtRear)
- err = LoadData(ALBuf, freq, AL_FORMAT_REAR16, size, SrcChannels, SrcType, data);
- else
+ case SrcFmtMulaw: {
+ ALenum NewFormat = AL_FORMAT_MONO16;
+ switch(SrcChannels)
{
- ALuint Channels = ChannelsFromSrcFmt(SrcChannels);
- ALenum NewFormat = ((Channels==1) ? AL_FORMAT_MONO16 :
- ((Channels==2) ? AL_FORMAT_STEREO16 :
- ((Channels==4) ? AL_FORMAT_QUAD16 :
- ((Channels==6) ? AL_FORMAT_51CHN16 :
- ((Channels==7) ? AL_FORMAT_61CHN16 :
- AL_FORMAT_71CHN16)))));
- err = LoadData(ALBuf, freq, NewFormat, size, SrcChannels, SrcType, data);
+ case SrcFmtMono: NewFormat = AL_FORMAT_MONO16; break;
+ case SrcFmtStereo: NewFormat = AL_FORMAT_STEREO16; break;
+ case SrcFmtRear: NewFormat = AL_FORMAT_REAR16; break;
+ case SrcFmtQuad: NewFormat = AL_FORMAT_QUAD16; break;
+ case SrcFmtX51: NewFormat = AL_FORMAT_51CHN16; break;
+ case SrcFmtX61: NewFormat = AL_FORMAT_61CHN16; break;
+ case SrcFmtX71: NewFormat = AL_FORMAT_71CHN16; break;
}
+ err = LoadData(ALBuf, freq, NewFormat, size, SrcChannels, SrcType, data);
if(err != AL_NO_ERROR)
alSetError(Context, err);
- break;
+ } break;
case SrcFmtIMA4: {
enum FmtChannels DstChannels = ((SrcChannels==SrcFmtMono) ?