aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/mixer.c8
-rw-r--r--OpenAL32/Include/alBuffer.h2
-rw-r--r--OpenAL32/alBuffer.c24
3 files changed, 17 insertions, 17 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index d1796da8..fe4bcd78 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -193,8 +193,8 @@ void aluInitMixer(void)
}
-static inline ALfloat Sample_ALbyte(ALbyte val)
-{ return val * (1.0f/128.0f); }
+static inline ALfloat Sample_ALubyte(ALubyte val)
+{ return (val-128) * (1.0f/128.0f); }
static inline ALfloat Sample_ALshort(ALshort val)
{ return val * (1.0f/32768.0f); }
@@ -219,7 +219,7 @@ static inline void Load_##T(ALfloat *restrict dst, const T *restrict src, \
dst[i] += Sample_##T(src[i*srcstep]); \
}
-DECL_TEMPLATE(ALbyte)
+DECL_TEMPLATE(ALubyte)
DECL_TEMPLATE(ALshort)
DECL_TEMPLATE(ALfloat)
DECL_TEMPLATE(ALmulaw)
@@ -233,7 +233,7 @@ static void LoadSamples(ALfloat *restrict dst, const ALvoid *restrict src, ALint
#define HANDLE_FMT(ET, ST) case ET: Load_##ST(dst, src, srcstep, samples); break
switch(srctype)
{
- HANDLE_FMT(FmtByte, ALbyte);
+ HANDLE_FMT(FmtUByte, ALubyte);
HANDLE_FMT(FmtShort, ALshort);
HANDLE_FMT(FmtFloat, ALfloat);
HANDLE_FMT(FmtMulaw, ALmulaw);
diff --git a/OpenAL32/Include/alBuffer.h b/OpenAL32/Include/alBuffer.h
index 0f39dfae..852a8782 100644
--- a/OpenAL32/Include/alBuffer.h
+++ b/OpenAL32/Include/alBuffer.h
@@ -44,7 +44,7 @@ inline ALsizei FrameSizeFromUserFmt(enum UserFmtChannels chans, enum UserFmtType
/* Storable formats */
enum FmtType {
- FmtByte = UserFmtByte,
+ FmtUByte = UserFmtUByte,
FmtShort = UserFmtShort,
FmtFloat = UserFmtFloat,
FmtMulaw = UserFmtMulaw,
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 1b15a1b3..d063b071 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -959,7 +959,7 @@ done:
static ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei frames, enum UserFmtChannels SrcChannels, enum UserFmtType SrcType, const ALvoid *data, ALsizei align, ALboolean storesrc)
{
enum FmtChannels DstChannels = FmtMono;
- enum FmtType DstType = FmtByte;
+ enum FmtType DstType = FmtUByte;
ALuint NewChannels, NewBytes;
ALuint64 newsize;
@@ -1169,7 +1169,7 @@ ALsizei BytesFromFmt(enum FmtType type)
{
switch(type)
{
- case FmtByte: return sizeof(ALbyte);
+ case FmtUByte: return sizeof(ALubyte);
case FmtShort: return sizeof(ALshort);
case FmtFloat: return sizeof(ALfloat);
case FmtMulaw: return sizeof(ALubyte);
@@ -1200,52 +1200,52 @@ static ALboolean DecomposeFormat(ALenum format, enum FmtChannels *chans, enum Fm
enum FmtChannels channels;
enum FmtType type;
} list[] = {
- { AL_FORMAT_MONO8, FmtMono, FmtByte },
+ { AL_FORMAT_MONO8, FmtMono, FmtUByte },
{ AL_FORMAT_MONO16, FmtMono, FmtShort },
{ AL_FORMAT_MONO_FLOAT32, FmtMono, FmtFloat },
{ AL_FORMAT_MONO_MULAW, FmtMono, FmtMulaw },
{ AL_FORMAT_MONO_ALAW_EXT, FmtMono, FmtAlaw },
- { AL_FORMAT_STEREO8, FmtStereo, FmtByte },
+ { AL_FORMAT_STEREO8, FmtStereo, FmtUByte },
{ AL_FORMAT_STEREO16, FmtStereo, FmtShort },
{ AL_FORMAT_STEREO_FLOAT32, FmtStereo, FmtFloat },
{ AL_FORMAT_STEREO_MULAW, FmtStereo, FmtMulaw },
{ AL_FORMAT_STEREO_ALAW_EXT, FmtStereo, FmtAlaw },
- { AL_FORMAT_REAR8, FmtRear, FmtByte },
+ { AL_FORMAT_REAR8, FmtRear, FmtUByte },
{ AL_FORMAT_REAR16, FmtRear, FmtShort },
{ AL_FORMAT_REAR32, FmtRear, FmtFloat },
{ AL_FORMAT_REAR_MULAW, FmtRear, FmtMulaw },
- { AL_FORMAT_QUAD8_LOKI, FmtQuad, FmtByte },
+ { AL_FORMAT_QUAD8_LOKI, FmtQuad, FmtUByte },
{ AL_FORMAT_QUAD16_LOKI, FmtQuad, FmtShort },
- { AL_FORMAT_QUAD8, FmtQuad, FmtByte },
+ { AL_FORMAT_QUAD8, FmtQuad, FmtUByte },
{ AL_FORMAT_QUAD16, FmtQuad, FmtShort },
{ AL_FORMAT_QUAD32, FmtQuad, FmtFloat },
{ AL_FORMAT_QUAD_MULAW, FmtQuad, FmtMulaw },
- { AL_FORMAT_51CHN8, FmtX51, FmtByte },
+ { AL_FORMAT_51CHN8, FmtX51, FmtUByte },
{ AL_FORMAT_51CHN16, FmtX51, FmtShort },
{ AL_FORMAT_51CHN32, FmtX51, FmtFloat },
{ AL_FORMAT_51CHN_MULAW, FmtX51, FmtMulaw },
- { AL_FORMAT_61CHN8, FmtX61, FmtByte },
+ { AL_FORMAT_61CHN8, FmtX61, FmtUByte },
{ AL_FORMAT_61CHN16, FmtX61, FmtShort },
{ AL_FORMAT_61CHN32, FmtX61, FmtFloat },
{ AL_FORMAT_61CHN_MULAW, FmtX61, FmtMulaw },
- { AL_FORMAT_71CHN8, FmtX71, FmtByte },
+ { AL_FORMAT_71CHN8, FmtX71, FmtUByte },
{ AL_FORMAT_71CHN16, FmtX71, FmtShort },
{ AL_FORMAT_71CHN32, FmtX71, FmtFloat },
{ AL_FORMAT_71CHN_MULAW, FmtX71, FmtMulaw },
- { AL_FORMAT_BFORMAT2D_8, FmtBFormat2D, FmtByte },
+ { AL_FORMAT_BFORMAT2D_8, FmtBFormat2D, FmtUByte },
{ AL_FORMAT_BFORMAT2D_16, FmtBFormat2D, FmtShort },
{ AL_FORMAT_BFORMAT2D_FLOAT32, FmtBFormat2D, FmtFloat },
{ AL_FORMAT_BFORMAT2D_MULAW, FmtBFormat2D, FmtMulaw },
- { AL_FORMAT_BFORMAT3D_8, FmtBFormat3D, FmtByte },
+ { AL_FORMAT_BFORMAT3D_8, FmtBFormat3D, FmtUByte },
{ AL_FORMAT_BFORMAT3D_16, FmtBFormat3D, FmtShort },
{ AL_FORMAT_BFORMAT3D_FLOAT32, FmtBFormat3D, FmtFloat },
{ AL_FORMAT_BFORMAT3D_MULAW, FmtBFormat3D, FmtMulaw },