aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/pulseaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-13 21:53:34 -0700
committerChris Robinson <[email protected]>2011-09-13 21:53:34 -0700
commita4f8408150edf94b8ff684c6c383d87f99e77e76 (patch)
tree6f23e31fbcc056626901ef60dc5ed62dcb37c970 /Alc/backends/pulseaudio.c
parent80f2b787efbd226bec702aee7aa7c0f973a3d692 (diff)
Use maxu to clamp PulseAudio's capture buffer size
Diffstat (limited to 'Alc/backends/pulseaudio.c')
-rw-r--r--Alc/backends/pulseaudio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c
index 252eed41..804ceacb 100644
--- a/Alc/backends/pulseaudio.c
+++ b/Alc/backends/pulseaudio.c
@@ -1134,8 +1134,7 @@ static ALCenum pulse_open_capture(ALCdevice *device, const ALCchar *device_name)
data->samples = device->UpdateSize * device->NumUpdates;
data->frame_size = FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
- if(data->samples < 100 * device->Frequency / 1000)
- data->samples = 100 * device->Frequency / 1000;
+ data->samples = maxu(data->samples, 100 * device->Frequency / 1000);
if(!(data->ring = CreateRingBuffer(data->frame_size, data->samples)))
{