diff options
Diffstat (limited to 'Alc/backends/wave.c')
-rw-r--r-- | Alc/backends/wave.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Alc/backends/wave.c b/Alc/backends/wave.c index f4f21ecb..1df07078 100644 --- a/Alc/backends/wave.c +++ b/Alc/backends/wave.c @@ -81,45 +81,45 @@ static void fwrite32le(ALuint val, FILE *f) static ALuint WaveProc(ALvoid *ptr) { - ALCdevice *pDevice = (ALCdevice*)ptr; - wave_data *data = (wave_data*)pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)ptr; + wave_data *data = (wave_data*)Device->ExtraData; ALuint frameSize; ALuint now, start; ALuint64 avail, done; size_t fs; - const ALuint restTime = (ALuint64)pDevice->UpdateSize * 1000 / - pDevice->Frequency / 2; + const ALuint restTime = (ALuint64)Device->UpdateSize * 1000 / + Device->Frequency / 2; - frameSize = FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType); + frameSize = FrameSizeFromDevFmt(Device->FmtChans, Device->FmtType); done = 0; start = timeGetTime(); - while(!data->killNow && pDevice->Connected) + while(!data->killNow && Device->Connected) { now = timeGetTime(); - avail = (ALuint64)(now-start) * pDevice->Frequency / 1000; + avail = (ALuint64)(now-start) * Device->Frequency / 1000; if(avail < done) { /* Timer wrapped (50 days???). Add the remainder of the cycle to * the available count and reset the number of samples done */ - avail += ((ALuint64)1<<32)*pDevice->Frequency/1000 - done; + avail += ((ALuint64)1<<32)*Device->Frequency/1000 - done; done = 0; } - if(avail-done < pDevice->UpdateSize) + if(avail-done < Device->UpdateSize) { Sleep(restTime); continue; } - while(avail-done >= pDevice->UpdateSize) + while(avail-done >= Device->UpdateSize) { - aluMixData(pDevice, data->buffer, pDevice->UpdateSize); - done += pDevice->UpdateSize; + aluMixData(Device, data->buffer, Device->UpdateSize); + done += Device->UpdateSize; if(!IS_LITTLE_ENDIAN) { - ALuint bytesize = BytesFromDevFmt(pDevice->FmtType); + ALuint bytesize = BytesFromDevFmt(Device->FmtType); ALubyte *bytes = data->buffer; ALuint i; @@ -140,12 +140,12 @@ static ALuint WaveProc(ALvoid *ptr) } } else - fs = fwrite(data->buffer, frameSize, pDevice->UpdateSize, + fs = fwrite(data->buffer, frameSize, Device->UpdateSize, data->f); if(ferror(data->f)) { ERR("Error writing to file\n"); - aluHandleDisconnect(pDevice); + aluHandleDisconnect(Device); break; } } |