aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/alsa.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-14 02:01:35 -0700
committerChris Robinson <[email protected]>2011-09-14 02:01:35 -0700
commit97024151e49d97ed3ae9d73a9426de0f1a9ebb0f (patch)
tree841c413a23725d55a6b872b531bcc38689ba96cd /Alc/backends/alsa.c
parent62dfea43c699cb18a7538980794106d3ac0edca6 (diff)
Return an error from the CaptureSamples method instead of setting it
Diffstat (limited to 'Alc/backends/alsa.c')
-rw-r--r--Alc/backends/alsa.c10
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;
}