PulseAudio: Fix a crash when initializing multiple devices.
This was due to context-level mainloop being accessed from different audio threads at the same time. I've fixed this by giving each device their own pa_mainloop and pa_context objects. I considered the idea of having only a single context-level mainloop and just using a mutex for mutal exclusion, but that would involve a lock in the audio thread's data loop which I wasn't happy about. Also, I wasn't sure which thread PulseAudio callbacks would get fired from since the main loop would be iterated on different audio threads. Public issue https://github.com/mackron/miniaudio/issues/376
Showing
This diff is collapsed.
Please register or sign in to comment