diff options
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; } |