diff options
author | Chris Robinson <[email protected]> | 2008-10-10 01:13:32 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-10-10 01:13:32 -0700 |
commit | 36f133a5ae4c1d9ed4cf4769d69fea54e825822d (patch) | |
tree | 02c326f748c7b2840573d7a0579d6ac06d836f7d /Alc | |
parent | 74a58c0d095417b7dc1192eb608b718f212ab27d (diff) |
Use a modulo to keep the buffer position in range for looping sources
A high pitch and low buffer size can cause a lot of unnecessary iterations
otherwise, that just decrement the position
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -931,7 +931,10 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma } ALSource->ulBufferID = ALSource->queue->buffer; - ALSource->position = DataPosInt-DataSize; + if(ALSource->BuffersInQueue == 1) + ALSource->position = DataPosInt%DataSize; + else + ALSource->position = DataPosInt-DataSize; ALSource->position_fraction = DataPosFrac; } } |