aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/pulseaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-03-11 09:47:26 -0800
committerChris Robinson <[email protected]>2010-03-11 09:47:26 -0800
commit3108a6a997e47e268a8dadc61874d05077a92605 (patch)
tree8118fcfb5200434a508d72699b37476e0a56f586 /Alc/pulseaudio.c
parentb734cab6fcbd7d3338c04fd9a90f6dca39ef2827 (diff)
Limit PulseAudio's buffer size to the requested length
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r--Alc/pulseaudio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c
index e3b12838..8c71acd1 100644
--- a/Alc/pulseaudio.c
+++ b/Alc/pulseaudio.c
@@ -616,12 +616,12 @@ static ALCboolean pulse_reset_playback(ALCdevice *device) //{{{
data->stream_name = "Playback Stream";
data->attr.minreq = -1;
data->attr.prebuf = -1;
- data->attr.maxlength = -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.maxlength = data->attr.tlength;
switch(aluBytesFromFormat(device->Format))
{
@@ -708,6 +708,7 @@ static ALCboolean pulse_reset_playback(ALCdevice *device) //{{{
* accordingly. */
data->attr.tlength = (ALuint64)(data->attr.tlength/data->frame_size) *
data->spec.rate / device->Frequency * data->frame_size;
+ data->attr.maxlength = data->attr.tlength;
o = ppa_stream_set_buffer_attr(data->stream, &data->attr,
stream_success_callback, device);