aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
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)();
}