aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-03-14 22:20:55 -0700
committerChris Robinson <[email protected]>2010-03-14 22:20:55 -0700
commitd4159430f010625b44c48a1270d5e09348957e9b (patch)
treeb7e3543cccfaa73a5549deb3a40413f257e30928 /Alc
parent14255a38fcc36ba87ee2aa7b867845b13a44c573 (diff)
Set the buffer length for Pulse when opening the device
So it will properly scale with context frequency requests
Diffstat (limited to 'Alc')
-rw-r--r--Alc/pulseaudio.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c
index c8352b6b..d91d2e16 100644
--- a/Alc/pulseaudio.c
+++ b/Alc/pulseaudio.c
@@ -566,7 +566,15 @@ static ALCboolean pulse_open_playback(ALCdevice *device, const ALCchar *device_n
return ALC_FALSE;
if(pulse_open(device, device_name) != ALC_FALSE)
+ {
+ ALuint len = GetConfigValueInt("pulse", "buffer-length", 2048);
+ if(len != 0)
+ {
+ device->UpdateSize = len;
+ device->NumUpdates = 1;
+ }
return ALC_TRUE;
+ }
pulse_unload();
return ALC_FALSE;
@@ -619,10 +627,8 @@ static ALCboolean pulse_reset_playback(ALCdevice *device) //{{{
data->attr.minreq = -1;
data->attr.prebuf = -1;
data->attr.fragsize = -1;
- data->attr.tlength = GetConfigValueInt("pulse", "buffer-length", 2048);
- if(data->attr.tlength == 0)
- data->attr.tlength = device->UpdateSize * device->NumUpdates;
- data->attr.tlength *= data->frame_size;
+ data->attr.tlength = device->UpdateSize * device->NumUpdates *
+ data->frame_size;
data->attr.maxlength = data->attr.tlength;
switch(aluBytesFromFormat(device->Format))