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/ALc.c | |
parent | 62dfea43c699cb18a7538980794106d3ac0edca6 (diff) |
Return an error from the CaptureSamples method instead of setting it
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -1730,17 +1730,16 @@ ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device) ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples) { - if(!(device=VerifyDevice(device)) || !device->IsCaptureDevice) + ALCenum err = ALC_INVALID_DEVICE; + if((device=VerifyDevice(device)) != NULL && device->IsCaptureDevice) { - alcSetError(device, ALC_INVALID_DEVICE); - if(device) ALCdevice_DecRef(device); - return; + LockDevice(device); + err = ALCdevice_CaptureSamples(device, buffer, samples); + UnlockDevice(device); } - LockDevice(device); - ALCdevice_CaptureSamples(device, buffer, samples); - UnlockDevice(device); - - ALCdevice_DecRef(device); + if(err != ALC_NO_ERROR) + alcSetError(device, err); + if(device) ALCdevice_DecRef(device); } /* |