diff options
author | Chris Robinson <[email protected]> | 2011-09-14 02:01:35 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-14 02:01:35 -0700 |
commit | 97024151e49d97ed3ae9d73a9426de0f1a9ebb0f (patch) | |
tree | 841c413a23725d55a6b872b531bcc38689ba96cd /Alc/backends/oss.c | |
parent | 62dfea43c699cb18a7538980794106d3ac0edca6 (diff) |
Return an error from the CaptureSamples method instead of setting it
Diffstat (limited to 'Alc/backends/oss.c')
-rw-r--r-- | Alc/backends/oss.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Alc/backends/oss.c b/Alc/backends/oss.c index c94e3044..79830c06 100644 --- a/Alc/backends/oss.c +++ b/Alc/backends/oss.c @@ -461,19 +461,19 @@ static void oss_stop_capture(ALCdevice *pDevice) data->doCapture = 0; } -static void oss_capture_samples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCuint lSamples) +static ALCuint oss_available_samples(ALCdevice *pDevice) { oss_data *data = (oss_data*)pDevice->ExtraData; - if(lSamples <= (ALCuint)RingBufferSize(data->ring)) - ReadRingBuffer(data->ring, pBuffer, lSamples); - else - alcSetError(pDevice, ALC_INVALID_VALUE); + return RingBufferSize(data->ring); } -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); + if(oss_available_samples(pDevice) < lSamples) + return ALC_INVALID_VALUE; + ReadRingBuffer(data->ring, pBuffer, lSamples); + return ALC_NO_ERROR; } |