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