summaryrefslogtreecommitdiffstats
path: root/Alc/backends/oss.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-18 20:27:34 -0700
committerChris Robinson <[email protected]>2011-09-18 20:27:34 -0700
commitcc3dd648ace1f1276e909dcb07adf782a39f1cf3 (patch)
treeb23d5bb282553f028d96795320d2f5b5b10de5fe /Alc/backends/oss.c
parent98b2fa6cb523cab6702bfeee36e089711012b9d8 (diff)
Check the number of available samples before calling the capture method
Diffstat (limited to 'Alc/backends/oss.c')
-rw-r--r--Alc/backends/oss.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/Alc/backends/oss.c b/Alc/backends/oss.c
index 79830c06..9206343b 100644
--- a/Alc/backends/oss.c
+++ b/Alc/backends/oss.c
@@ -461,19 +461,17 @@ static void oss_stop_capture(ALCdevice *pDevice)
data->doCapture = 0;
}
-static ALCuint oss_available_samples(ALCdevice *pDevice)
+static ALCenum oss_capture_samples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCuint lSamples)
{
oss_data *data = (oss_data*)pDevice->ExtraData;
- return RingBufferSize(data->ring);
+ ReadRingBuffer(data->ring, pBuffer, lSamples);
+ return ALC_NO_ERROR;
}
-static ALCenum oss_capture_samples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCuint lSamples)
+static ALCuint oss_available_samples(ALCdevice *pDevice)
{
oss_data *data = (oss_data*)pDevice->ExtraData;
- if(oss_available_samples(pDevice) < lSamples)
- return ALC_INVALID_VALUE;
- ReadRingBuffer(data->ring, pBuffer, lSamples);
- return ALC_NO_ERROR;
+ return RingBufferSize(data->ring);
}