diff options
author | Chris Robinson <[email protected]> | 2010-11-21 11:34:16 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-11-21 11:34:16 -0800 |
commit | c58469e2341b39662ab825ee35d70a9d17b78f74 (patch) | |
tree | 9375ee5058c609cad123a2e64b47c279071432e5 | |
parent | 57a03bc2b5a63e95d96bcfd46abd26b02400574c (diff) |
Handle the timer wrapping in the wave and null output devices
-rw-r--r-- | Alc/null.c | 7 | ||||
-rw-r--r-- | Alc/wave.c | 7 |
2 files changed, 8 insertions, 6 deletions
@@ -55,9 +55,10 @@ static ALuint NullProc(ALvoid *ptr) avail = (ALuint64)(now-start) * Device->Frequency / 1000; if(avail < done) { - AL_PRINT("Timer wrapped\n"); - aluHandleDisconnect(Device); - break; + /* Timer wrapped. Add the remainder of the cycle to the available + * count and reset the number of samples done */ + avail += 0xFFFFFFFFu*Device->Frequency/1000 - done; + done = 0; } if(avail-done < Device->UpdateSize) { @@ -106,9 +106,10 @@ static ALuint WaveProc(ALvoid *ptr) avail = (ALuint64)(now-start) * pDevice->Frequency / 1000; if(avail < done) { - AL_PRINT("Timer wrapped\n"); - aluHandleDisconnect(pDevice); - break; + /* Timer wrapped. Add the remainder of the cycle to the available + * count and reset the number of samples done */ + avail += 0xFFFFFFFFu*pDevice->Frequency/1000 - done; + done = 0; } if(avail-done < pDevice->UpdateSize) { |