diff options
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r-- | OpenAL32/alSource.c | 18 |
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; |