diff options
author | Chris Robinson <[email protected]> | 2013-10-05 00:33:56 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-10-05 00:33:56 -0700 |
commit | 43c375716a7f3cd73f3b3ce8bb03136bef4f5d82 (patch) | |
tree | e5b712e00e5ece4c6a7def60f894dd978bbc4a74 /Alc/backends/null.c | |
parent | ead8573aaf9d5dbe37a6224678188d54d1f0566d (diff) |
Only rest as long as needed in the Null renderer
Diffstat (limited to 'Alc/backends/null.c')
-rw-r--r-- | Alc/backends/null.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Alc/backends/null.c b/Alc/backends/null.c index 93b38063..d001cb41 100644 --- a/Alc/backends/null.c +++ b/Alc/backends/null.c @@ -43,8 +43,6 @@ static ALuint NullProc(ALvoid *ptr) null_data *data = (null_data*)Device->ExtraData; ALuint now, start; ALuint64 avail, done; - const ALuint restTime = (ALuint64)Device->UpdateSize * 1000 / - Device->Frequency / 2; done = 0; start = timeGetTime(); @@ -62,15 +60,16 @@ static ALuint NullProc(ALvoid *ptr) } if(avail-done < Device->UpdateSize) { + ALuint restTime = (Device->UpdateSize - (avail-done)) * 1000 / + Device->Frequency; Sleep(restTime); continue; } - while(avail-done >= Device->UpdateSize) - { + do { aluMixData(Device, NULL, Device->UpdateSize); done += Device->UpdateSize; - } + } while(avail-done >= Device->UpdateSize); } return 0; |