From 026b4b8f4cfaf50638319e9869d14a1262134f31 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 12 Jan 2010 02:26:38 -0800 Subject: Better handle large second offsets --- OpenAL32/alSource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenAL32') diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 441f8275..4ed1ee6b 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -2136,8 +2136,8 @@ static ALint GetByteOffset(ALsource *pSource) case AL_SEC_OFFSET: // Note - lOffset is internally stored as Milliseconds - lByteOffset = (ALint)(pSource->lOffset * lChannels * lBytes * flBufferFreq / 1000.0f); - lByteOffset -= (lByteOffset % (lChannels * lBytes)); + lByteOffset = (ALint)(pSource->lOffset / 1000.0f * flBufferFreq); + lByteOffset *= lChannels * lBytes; break; } -- cgit v1.2.3