From 5f6f046d258d44daf5a6094bf3e7371231bfe1d4 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 7 Nov 2010 21:41:04 -0800 Subject: Use a double when converting millisecond offsets to byte offsets --- OpenAL32/alSource.c | 6 +++--- 1 file 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; } -- cgit v1.2.3