aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-03-24 22:20:55 -0700
committerChris Robinson <[email protected]>2010-03-24 22:20:55 -0700
commit15b9fc9099da9ce9d7a2848fa09bbb4711aeca87 (patch)
tree64fe8d2f5c9b05a262563abc032203962de875de
parent1c14c13c2fe095614a6b53b08174ee16cbcddd22 (diff)
Improve timing for the wave file writer
-rw-r--r--Alc/wave.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/wave.c b/Alc/wave.c
index 37358098..4ed120bb 100644
--- a/Alc/wave.c
+++ b/Alc/wave.c
@@ -80,12 +80,12 @@ static ALuint WaveProc(ALvoid *ptr)
frameSize = aluBytesFromFormat(pDevice->Format) *
aluChannelsFromFormat(pDevice->Format);
- last = timeGetTime();
+ last = timeGetTime()<<8;
while(!data->killNow && pDevice->Connected)
{
- now = timeGetTime();
+ now = timeGetTime()<<8;
- avail = (now-last) * pDevice->Frequency / 1000;
+ avail = (ALuint64)(now-last) * pDevice->Frequency / (1000<<8);
if(avail < pDevice->UpdateSize)
{
Sleep(1);
@@ -128,8 +128,8 @@ static ALuint WaveProc(ALvoid *ptr)
}
avail -= pDevice->UpdateSize;
+ last += (ALuint64)pDevice->UpdateSize * (1000<<8) / pDevice->Frequency;
}
- last = now;
}
return 0;