summaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/pulseaudio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c
index 7687506f..621079f0 100644
--- a/Alc/pulseaudio.c
+++ b/Alc/pulseaudio.c
@@ -856,7 +856,11 @@ static void pulse_capture_samples(ALCdevice *device, ALCvoid *buffer, ALCuint sa
/* Any unread data in the fragment will be lost, so save it */
length /= data->frame_size;
if(length > 0)
- WriteRingBuffer(data->ring, buf, (length<data->samples) ? length : data->samples);
+ {
+ if(length > data->samples)
+ length = data->samples;
+ WriteRingBuffer(data->ring, buf, length);
+ }
ppa_stream_drop(data->stream);
}