From b56d50912eca6f90a5c279534f90c72da9473656 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 21 Dec 2014 12:46:04 -0800 Subject: Set error if capture device fails to start --- Alc/ALc.c | 14 ++++++++++---- 1 file 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)(); } -- cgit v1.2.3