aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-12-21 12:46:04 -0800
committerChris Robinson <[email protected]>2014-12-21 12:46:04 -0800
commitb56d50912eca6f90a5c279534f90c72da9473656 (patch)
tree3bcc3a61907ecb407275c581e47f9c68ce77fc48 /Alc/ALc.c
parentc2975b5f44ed5553f6337e08d70471a7627581da (diff)
Set error if capture device fails to start
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 2f174744..74b8e1ae 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -3621,11 +3621,17 @@ ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device)
else
{
V0(device->Backend,lock)();
- if(device->Connected)
+ if(!device->Connected)
+ alcSetError(device, ALC_INVALID_DEVICE);
+ else if(!(device->Flags&DEVICE_RUNNING))
{
- if(!(device->Flags&DEVICE_RUNNING))
- V0(device->Backend,start)();
- device->Flags |= DEVICE_RUNNING;
+ if(V0(device->Backend,start)())
+ device->Flags |= DEVICE_RUNNING;
+ else
+ {
+ aluHandleDisconnect(device);
+ alcSetError(device, ALC_INVALID_DEVICE);
+ }
}
V0(device->Backend,unlock)();
}