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/dsound.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Alc/backends/dsound.c') diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c index 512667cc..c6f666e1 100644 --- a/Alc/backends/dsound.c +++ b/Alc/backends/dsound.c @@ -244,7 +244,9 @@ static ALuint DSoundPlaybackProc(ALvoid *ptr) if(FAILED(err)) { ERR("Failed to get buffer caps: 0x%lx\n", err); + ALCdevice_Lock(Device); aluHandleDisconnect(Device); + ALCdevice_Unlock(Device); return 1; } @@ -266,7 +268,9 @@ static ALuint DSoundPlaybackProc(ALvoid *ptr) if(FAILED(err)) { ERR("Failed to play buffer: 0x%lx\n", err); + ALCdevice_Lock(Device); aluHandleDisconnect(Device); + ALCdevice_Unlock(Device); return 1; } Playing = TRUE; @@ -310,7 +314,9 @@ static ALuint DSoundPlaybackProc(ALvoid *ptr) else { ERR("Buffer lock error: %#lx\n", err); + ALCdevice_Lock(Device); aluHandleDisconnect(Device); + ALCdevice_Unlock(Device); return 1; } -- cgit v1.2.3