出现问题的Qt版本是: 5.15.1
问题现象:
程序崩溃,弹窗提示为:
ASSERT:"(mode == QAudio::Audiolnput ? gMapping->inputDeviceNames.indexOf(dev) : gMapping->outputDeviceNames.indexOf(dev)) != -1" in file qwasapiutils.cpp, line 312
问题原因
QAudioDeviceInfo::availableDevices
这个函数非线程安全函数,多线程下使用需要加互斥锁避免同时调用。如果没有使用这个函数出现了错误,那可能是使用了其它的Qt非线程安全函数