diff options
Diffstat (limited to 'Alc/backends/alsa.c')
-rw-r--r-- | Alc/backends/alsa.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c index 7fa8f7b8..d953f52f 100644 --- a/Alc/backends/alsa.c +++ b/Alc/backends/alsa.c @@ -1040,14 +1040,14 @@ static ALCuint alsa_available_samples(ALCdevice *Device) return RingBufferSize(data->ring); } -static void alsa_capture_samples(ALCdevice *Device, ALCvoid *Buffer, ALCuint Samples) +static ALCenum alsa_capture_samples(ALCdevice *Device, ALCvoid *Buffer, ALCuint Samples) { alsa_data *data = (alsa_data*)Device->ExtraData; - if(Samples <= alsa_available_samples(Device)) - ReadRingBuffer(data->ring, Buffer, Samples); - else - alcSetError(Device, ALC_INVALID_VALUE); + if(alsa_available_samples(Device) < Samples) + return ALC_INVALID_VALUE; + ReadRingBuffer(data->ring, Buffer, Samples); + return ALC_NO_ERROR; } |