diff options
author | Chris Robinson <[email protected]> | 2010-06-05 04:42:05 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-06-05 04:42:05 -0700 |
commit | 98c01a40e6ab15639d4afd5bc63a4a42c24f6838 (patch) | |
tree | 1216206c24efa942b2824ba546669cb043adcc14 /Alc/ALc.c | |
parent | 33234d605aca6c7f9a153e428191db146a5177b9 (diff) |
Improve locking when calling the backend capture API
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 24 |
1 files changed, 9 insertions, 15 deletions
@@ -1003,37 +1003,31 @@ ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *pDevice) ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device) { + SuspendContext(NULL); if(!IsDevice(device) || !device->IsCaptureDevice) - { alcSetError(device, ALC_INVALID_DEVICE); - return; - } - SuspendContext(NULL); - ALCdevice_StartCapture(device); + else if(device->Connected) + ALCdevice_StartCapture(device); ProcessContext(NULL); } ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device) { + SuspendContext(NULL); if(!IsDevice(device) || !device->IsCaptureDevice) - { alcSetError(device, ALC_INVALID_DEVICE); - return; - } - SuspendContext(NULL); - ALCdevice_StopCapture(device); + else + ALCdevice_StopCapture(device); ProcessContext(NULL); } ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples) { + SuspendContext(NULL); if(!IsDevice(device) || !device->IsCaptureDevice) - { alcSetError(device, ALC_INVALID_DEVICE); - return; - } - SuspendContext(NULL); - ALCdevice_CaptureSamples(device, buffer, samples); + else + ALCdevice_CaptureSamples(device, buffer, samples); ProcessContext(NULL); } |