During periodic unplugging of headphones, I call the device stop function ma_device_stop() and ma_device_uninit(), then re-initialize and start the available audio device (speaker or headphones). The program often deadlock on the ma_device_uninit() function. Previously, I could call these functions from different threads, but then I changed it and call from one thread. But the deadlock remains. Tell me how I can get rid of the application deadlock?
app.log
miniaudio.log