diff options
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r-- | Alc/pulseaudio.c | 6 |
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); } |