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/pulseaudio.c | |
parent | 62dfea43c699cb18a7538980794106d3ac0edca6 (diff) |
Return an error from the CaptureSamples method instead of setting it
Diffstat (limited to 'Alc/backends/pulseaudio.c')
-rw-r--r-- | Alc/backends/pulseaudio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 804ceacb..2382a708 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -1297,14 +1297,14 @@ static ALCuint pulse_available_samples(ALCdevice *device) //{{{ return RingBufferSize(data->ring); } //}}} -static void pulse_capture_samples(ALCdevice *device, ALCvoid *buffer, ALCuint samples) //{{{ +static ALCenum pulse_capture_samples(ALCdevice *device, ALCvoid *buffer, ALCuint samples) //{{{ { pulse_data *data = device->ExtraData; - if(pulse_available_samples(device) >= samples) - ReadRingBuffer(data->ring, buffer, samples); - else - alcSetError(device, ALC_INVALID_VALUE); + if(pulse_available_samples(device) < samples) + return ALC_INVALID_VALUE; + ReadRingBuffer(data->ring, buffer, samples); + return ALC_NO_ERROR; } //}}} |