From 1fb9311d82ff7e591aabb209eb5aaba108efc20e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 2 Dec 2012 11:20:20 -0800 Subject: Lock the device before calling aluHandleDisconnect PulseAudio causes an assert if being relocked inside a callback on the worker thread, where aluHandleDisconnect is called. We can assume it's already locked there, so just make sure the device is locked before being calling it. --- Alc/backends/alsa.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Alc/backends/alsa.c') diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c index 035d38e9..5ff6307f 100644 --- a/Alc/backends/alsa.c +++ b/Alc/backends/alsa.c @@ -472,7 +472,9 @@ static ALuint ALSAProc(ALvoid *ptr) if(state < 0) { ERR("Invalid state detected: %s\n", snd_strerror(state)); + ALCdevice_Lock(Device); aluHandleDisconnect(Device); + ALCdevice_Unlock(Device); break; } @@ -559,7 +561,9 @@ static ALuint ALSANoMMapProc(ALvoid *ptr) if(state < 0) { ERR("Invalid state detected: %s\n", snd_strerror(state)); + ALCdevice_Lock(Device); aluHandleDisconnect(Device); + ALCdevice_Unlock(Device); break; } -- cgit v1.2.3