aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcat <[email protected]>2018-06-07 19:30:34 -0700
committerGitHub <[email protected]>2018-06-07 19:30:34 -0700
commit9c643f035671cbfa8c9c76d246b317778c6917d9 (patch)
tree0dba9aa357f8640b89f44e56ee78e677f5671f75
parentbd9c6989c20ea40cc12dd54105ec708c4b28beaa (diff)
parent35b78d55a4554d41bfcb8864c080ea1164c9b183 (diff)
Merge pull request #200 from kdhp/fix-199
Stop capture devices while closing
-rw-r--r--Alc/ALc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 1858c29b..2e9dc710 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -4401,6 +4401,12 @@ ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device)
}
UnlockLists();
+ almtx_lock(&device->BackendLock);
+ if((device->Flags&DEVICE_RUNNING))
+ V0(device->Backend,stop)();
+ device->Flags &= ~DEVICE_RUNNING;
+ almtx_unlock(&device->BackendLock);
+
ALCdevice_DecRef(device);
return ALC_TRUE;