aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
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);
}