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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user