aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-11-07 21:41:04 -0800
committerChris Robinson <[email protected]>2010-11-07 21:41:04 -0800
commit5f6f046d258d44daf5a6094bf3e7371231bfe1d4 (patch)
treed268e752a6a2281efdd4a6e645e47dd5cd6cf11c
parent65e033c64b2e46d8e0082df79becad82dda3c8c9 (diff)
Use a double when converting millisecond offsets to byte offsets
-rw-r--r--OpenAL32/alSource.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 3cb9242c..2270a246 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -1989,7 +1989,7 @@ static ALint GetByteOffset(ALsource *Source)
{
ALbuffer *Buffer = NULL;
ALbufferlistitem *BufferList;
- ALfloat BufferFreq;
+ ALdouble BufferFreq;
ALint Channels, Bytes;
ALint ByteOffset = -1;
@@ -2011,7 +2011,7 @@ static ALint GetByteOffset(ALsource *Source)
return -1;
}
- BufferFreq = ((ALfloat)Buffer->frequency);
+ BufferFreq = ((ALdouble)Buffer->frequency);
Channels = aluChannelsFromFormat(Buffer->format);
Bytes = aluBytesFromFormat(Buffer->format);
@@ -2031,7 +2031,7 @@ static ALint GetByteOffset(ALsource *Source)
case AL_SEC_OFFSET:
// Note - lOffset is internally stored as Milliseconds
- ByteOffset = (ALint)(Source->lOffset / 1000.0f * BufferFreq);
+ ByteOffset = (ALint)(Source->lOffset / 1000.0 * BufferFreq);
ByteOffset *= Channels * Bytes;
break;
}