aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-14 02:01:35 -0700
committerChris Robinson <[email protected]>2011-09-14 02:01:35 -0700
commit97024151e49d97ed3ae9d73a9426de0f1a9ebb0f (patch)
tree841c413a23725d55a6b872b531bcc38689ba96cd /Alc/ALc.c
parent62dfea43c699cb18a7538980794106d3ac0edca6 (diff)
Return an error from the CaptureSamples method instead of setting it
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);
}
/*