aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 7d9793aa..c5329cfa 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1730,17 +1730,16 @@ ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device)
ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples)
{
- if(!(device=VerifyDevice(device)) || !device->IsCaptureDevice)
+ ALCenum err = ALC_INVALID_DEVICE;
+ if((device=VerifyDevice(device)) != NULL && device->IsCaptureDevice)
{
- alcSetError(device, ALC_INVALID_DEVICE);
- if(device) ALCdevice_DecRef(device);
- return;
+ LockDevice(device);
+ err = ALCdevice_CaptureSamples(device, buffer, samples);
+ UnlockDevice(device);
}
- LockDevice(device);
- ALCdevice_CaptureSamples(device, buffer, samples);
- UnlockDevice(device);
-
- ALCdevice_DecRef(device);
+ if(err != ALC_NO_ERROR)
+ alcSetError(device, err);
+ if(device) ALCdevice_DecRef(device);
}
/*