aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-03-09 10:14:52 -0800
committerChris Robinson <[email protected]>2010-03-09 10:14:52 -0800
commit80f1ec0d7e2393c34695b92c0557f8faf01703d1 (patch)
tree725c77b57f29eececc63731da4230336a7ff0f11 /Alc
parent98f4f5a4f014817f8f84d4570c79da426c348516 (diff)
Protect some capture calls with a mutex
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 7332fd9e..78d25a28 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -763,7 +763,11 @@ ALCAPI ALCboolean ALCAPIENTRY alcCaptureCloseDevice(ALCdevice *pDevice)
ALCAPI void ALCAPIENTRY alcCaptureStart(ALCdevice *pDevice)
{
if(IsDevice(pDevice) && pDevice->IsCaptureDevice)
+ {
+ SuspendContext(NULL);
ALCdevice_StartCapture(pDevice);
+ ProcessContext(NULL);
+ }
else
alcSetError(pDevice, ALC_INVALID_DEVICE);
}
@@ -771,7 +775,11 @@ ALCAPI void ALCAPIENTRY alcCaptureStart(ALCdevice *pDevice)
ALCAPI void ALCAPIENTRY alcCaptureStop(ALCdevice *pDevice)
{
if(IsDevice(pDevice) && pDevice->IsCaptureDevice)
+ {
+ SuspendContext(NULL);
ALCdevice_StopCapture(pDevice);
+ ProcessContext(NULL);
+ }
else
alcSetError(pDevice, ALC_INVALID_DEVICE);
}
@@ -779,7 +787,11 @@ ALCAPI void ALCAPIENTRY alcCaptureStop(ALCdevice *pDevice)
ALCAPI void ALCAPIENTRY alcCaptureSamples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCsizei lSamples)
{
if(IsDevice(pDevice) && pDevice->IsCaptureDevice)
+ {
+ SuspendContext(NULL);
ALCdevice_CaptureSamples(pDevice, pBuffer, lSamples);
+ ProcessContext(NULL);
+ }
else
alcSetError(pDevice, ALC_INVALID_DEVICE);
}