aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index bf09450f..bf3d8174 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1126,6 +1126,14 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
for(i = 0;i < SamplesToDo;i++)
(*slot)->WetBuffer[0][i] = 0.0f;
}
+
+ /* Increment the clock time. Every second's worth of samples is
+ * converted and added to clock base so that large sample counts don't
+ * overflow during conversion. This also guarantees an exact, stable
+ * conversion. */
+ device->SamplesDone += SamplesToDo;
+ device->ClockBase += (device->SamplesDone/device->Frequency) * DEVICE_CLOCK_RES;
+ device->SamplesDone %= device->Frequency;
ALCdevice_Unlock(device);
/* Click-removal. Could do better; this only really handles immediate