diff options
author | Chris Robinson <[email protected]> | 2009-09-16 22:58:54 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-09-16 22:58:54 -0700 |
commit | cbcaa54173bf6b14435adf3daf9feb2fa2e37d04 (patch) | |
tree | a56832a1ee9f96e72ac03a0424893714794cae4a /Alc/ALc.c | |
parent | 94e3fca7022c5c7f8147200ffdb3cda5ded62488 (diff) |
Store the number of periods in the device instead of the buffer size
Also keep all the fields in sync
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -614,7 +614,8 @@ ALCAPI ALCdevice* ALCAPIENTRY alcCaptureOpenDevice(const ALCchar *deviceName, AL pDevice->Frequency = frequency; pDevice->Format = format; - pDevice->BufferSize = SampleSize; + pDevice->UpdateSize = SampleSize; + pDevice->NumUpdates = 1; SuspendContext(NULL); for(i = 0;BackendList[i].Init;i++) @@ -1481,9 +1482,16 @@ ALCAPI ALCdevice* ALCAPIENTRY alcOpenDevice(const ALCchar *deviceName) fmt = GetConfigValue(NULL, "format", "AL_FORMAT_STEREO16"); device->Format = GetFormatFromString(fmt); - device->BufferSize = GetConfigValueInt(NULL, "refresh", 4096); - if((ALint)device->BufferSize <= 0) - device->BufferSize = 4096; + device->NumUpdates = GetConfigValueInt(NULL, "periods", 4); + if(device->NumUpdates < 2) + device->NumUpdates = 4; + + i = GetConfigValueInt(NULL, "refresh", 4096); + if(i <= 0) i = 4096; + + device->UpdateSize = GetConfigValueInt(NULL, "period_size", i/device->NumUpdates); + if(device->UpdateSize <= 0) + device->UpdateSize = i/device->NumUpdates; device->MaxNoOfSources = GetConfigValueInt(NULL, "sources", 256); if((ALint)device->MaxNoOfSources <= 0) |