summaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-09-16 22:58:54 -0700
committerChris Robinson <[email protected]>2009-09-16 22:58:54 -0700
commitcbcaa54173bf6b14435adf3daf9feb2fa2e37d04 (patch)
treea56832a1ee9f96e72ac03a0424893714794cae4a /Alc/ALc.c
parent94e3fca7022c5c7f8147200ffdb3cda5ded62488 (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.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 14fb3971..3a799dd9 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -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)