Use the correct channel conversion functions

This commit is contained in:
Chris Robinson 2017-04-11 11:47:23 -07:00
parent 78d5492d2c
commit 05531fbee4

View File

@ -359,7 +359,7 @@ void DestroyChannelConverter(ChannelConverter **converter)
#define DECL_TEMPLATE(T) \ #define DECL_TEMPLATE(T) \
static void MonoConvert##T(ALfloat *restrict dst, const T *src, ALsizei frames)\ static void Mono2Stereo##T(ALfloat *restrict dst, const T *src, ALsizei frames)\
{ \ { \
const T *data = (T*)src; \ const T *data = (T*)src; \
ALsizei i; \ ALsizei i; \
@ -368,7 +368,7 @@ static void MonoConvert##T(ALfloat *restrict dst, const T *src, ALsizei frames)\
dst[i*2 + 1] = dst[i*2 + 0] = Sample_##T(data[i]) * 0.707106781187f; \ dst[i*2 + 1] = dst[i*2 + 0] = Sample_##T(data[i]) * 0.707106781187f; \
} \ } \
\ \
static void StereoConvert##T(ALfloat *restrict dst, const T *src, ALsizei frames)\ static void Stereo2Mono##T(ALfloat *restrict dst, const T *src, ALsizei frames)\
{ \ { \
const T *data = (T*)src; \ const T *data = (T*)src; \
ALsizei i; \ ALsizei i; \
@ -402,25 +402,25 @@ void ChannelConverterInput(ChannelConverter *converter, const ALvoid *src, ALflo
switch(converter->mSrcType) switch(converter->mSrcType)
{ {
case DevFmtByte: case DevFmtByte:
MonoConvertALbyte(dst, src, frames); Stereo2MonoALbyte(dst, src, frames);
break; break;
case DevFmtUByte: case DevFmtUByte:
MonoConvertALubyte(dst, src, frames); Stereo2MonoALubyte(dst, src, frames);
break; break;
case DevFmtShort: case DevFmtShort:
MonoConvertALshort(dst, src, frames); Stereo2MonoALshort(dst, src, frames);
break; break;
case DevFmtUShort: case DevFmtUShort:
MonoConvertALushort(dst, src, frames); Stereo2MonoALushort(dst, src, frames);
break; break;
case DevFmtInt: case DevFmtInt:
MonoConvertALint(dst, src, frames); Stereo2MonoALint(dst, src, frames);
break; break;
case DevFmtUInt: case DevFmtUInt:
MonoConvertALuint(dst, src, frames); Stereo2MonoALuint(dst, src, frames);
break; break;
case DevFmtFloat: case DevFmtFloat:
MonoConvertALfloat(dst, src, frames); Stereo2MonoALfloat(dst, src, frames);
break; break;
} }
} }
@ -429,25 +429,25 @@ void ChannelConverterInput(ChannelConverter *converter, const ALvoid *src, ALflo
switch(converter->mSrcType) switch(converter->mSrcType)
{ {
case DevFmtByte: case DevFmtByte:
StereoConvertALbyte(dst, src, frames); Mono2StereoALbyte(dst, src, frames);
break; break;
case DevFmtUByte: case DevFmtUByte:
StereoConvertALubyte(dst, src, frames); Mono2StereoALubyte(dst, src, frames);
break; break;
case DevFmtShort: case DevFmtShort:
StereoConvertALshort(dst, src, frames); Mono2StereoALshort(dst, src, frames);
break; break;
case DevFmtUShort: case DevFmtUShort:
StereoConvertALushort(dst, src, frames); Mono2StereoALushort(dst, src, frames);
break; break;
case DevFmtInt: case DevFmtInt:
StereoConvertALint(dst, src, frames); Mono2StereoALint(dst, src, frames);
break; break;
case DevFmtUInt: case DevFmtUInt:
StereoConvertALuint(dst, src, frames); Mono2StereoALuint(dst, src, frames);
break; break;
case DevFmtFloat: case DevFmtFloat:
StereoConvertALfloat(dst, src, frames); Mono2StereoALfloat(dst, src, frames);
break; break;
} }
} }