Protect some capture calls with a mutex

This commit is contained in:
Chris Robinson 2010-03-09 10:14:52 -08:00
parent 98f4f5a4f0
commit 80f1ec0d7e

View File

@ -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);
}