aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/pulseaudio.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r--Alc/pulseaudio.c8
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);