diff options
author | Chris Robinson <[email protected]> | 2014-12-21 12:46:04 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-12-21 12:46:04 -0800 |
commit | b56d50912eca6f90a5c279534f90c72da9473656 (patch) | |
tree | 3bcc3a61907ecb407275c581e47f9c68ce77fc48 /Alc/ALc.c | |
parent | c2975b5f44ed5553f6337e08d70471a7627581da (diff) |
Set error if capture device fails to start
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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)(); } |