diff options
author | Chris Robinson <[email protected]> | 2010-07-04 16:27:42 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-07-04 16:27:42 -0700 |
commit | 969818db6fbadf2b3d42df63a9729f4476219d12 (patch) | |
tree | 689523d37b23e667bfe708b59cd6b86051f8b74d /Alc/pulseaudio.c | |
parent | d4b191d27d4ed749d20a6581bcdf567ae5cd00fc (diff) |
Use a 100ms capture buffer minimum for PulseAudio, with 50ms fragments
This better matches what is given with the WaveIn backend
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r-- | Alc/pulseaudio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 594126cf..dabcbaf0 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -977,6 +977,8 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na data->samples = device->UpdateSize * device->NumUpdates; data->frame_size = aluFrameSizeFromFormat(device->Format); + if(data->samples < 100 * device->Frequency / 1000) + data->samples = 100 * device->Frequency / 1000; if(!(data->ring = CreateRingBuffer(data->frame_size, data->samples))) { @@ -986,10 +988,10 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na data->attr.minreq = -1; data->attr.prebuf = -1; - data->attr.maxlength = data->frame_size * data->samples; + data->attr.maxlength = data->samples * data->frame_size; data->attr.tlength = -1; - data->attr.fragsize = min(data->frame_size * data->samples, - 10 * device->Frequency / 1000); + data->attr.fragsize = min(data->samples, 50 * device->Frequency / 1000) * + data->frame_size; data->spec.rate = device->Frequency; data->spec.channels = aluChannelsFromFormat(device->Format); |