aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2007-12-31 05:46:20 -0800
committerChris Robinson <[email protected]>2007-12-31 05:46:20 -0800
commit1397417fcd399663a91534c45b7863b2492af530 (patch)
treefa950e4d4f6070e1dc0bbea1044f90501cf0e863 /OpenAL32/alSource.c
parentc9a539eade6b5930bd2995b6226f5982d189190b (diff)
Handle AL_FORMAT_REAR* formats
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 9b4909c5..7fad9b90 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -1916,6 +1916,14 @@ static ALboolean GetSourceOffset(ALsource *pSource, ALenum eName, ALfloat *pflOf
// Round down to nearest ADPCM block
*pflOffset = (ALfloat)((lBytesPlayed / (36 * lChannels)) * 36 * lChannels);
}
+ else if (eOriginalFormat == AL_FORMAT_REAR8)
+ {
+ *pflOffset = (ALfloat)(lBytesPlayed >> 2);
+ }
+ else if (eOriginalFormat == AL_FORMAT_REAR16)
+ {
+ *pflOffset = (ALfloat)(lBytesPlayed >> 1);
+ }
else if (aluBytesFromFormat(eOriginalFormat) == 1)
{
*pflOffset = (ALfloat)(lBytesPlayed >> 1);
@@ -2071,6 +2079,16 @@ static ALint GetByteOffset(ALsource *pSource)
lByteOffset = (ALint)(3.6111f * (ALfloat)lByteOffset);
lByteOffset -= (lByteOffset % (lChannels * 2));
}
+ else if (pBuffer->eOriginalFormat == AL_FORMAT_REAR8)
+ {
+ lByteOffset = pSource->lOffset * 4;
+ lByteOffset -= (lByteOffset % (lChannels * 2));
+ }
+ else if (pBuffer->eOriginalFormat == AL_FORMAT_REAR16)
+ {
+ lByteOffset = pSource->lOffset * 2;
+ lByteOffset -= (lByteOffset % (lChannels * 2));
+ }
else if (aluBytesFromFormat(pBuffer->eOriginalFormat) == 1)
{
lByteOffset = pSource->lOffset * 2;