Commit d077e92f authored by David Reid's avatar David Reid

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
parent 4f07898b
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment