aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-06-05 04:42:05 -0700
committerChris Robinson <[email protected]>2010-06-05 04:42:05 -0700
commit98c01a40e6ab15639d4afd5bc63a4a42c24f6838 (patch)
tree1216206c24efa942b2824ba546669cb043adcc14 /Alc/ALc.c
parent33234d605aca6c7f9a153e428191db146a5177b9 (diff)
Improve locking when calling the backend capture API
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index c5704044..2a03765b 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -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);
}