mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Wake up the backend when uninitializing.
This commit is contained in:
@@ -45677,6 +45677,15 @@ MA_API void ma_device_uninit(ma_device* pDevice)
|
|||||||
#ifndef MA_NO_THREADING
|
#ifndef MA_NO_THREADING
|
||||||
if (pDevice->hasAudioThread) {
|
if (pDevice->hasAudioThread) {
|
||||||
ma_device_op_queue_push(&pDevice->opQueue, MA_DEVICE_OP_UNINIT, NULL, NULL);
|
ma_device_op_queue_push(&pDevice->opQueue, MA_DEVICE_OP_UNINIT, NULL, NULL);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Before waiting on the result, we need to make sure we try waking up the backend first in case it
|
||||||
|
needs a prod.
|
||||||
|
*/
|
||||||
|
if (pDevice->pContext->pVTable->onDeviceWakeup != NULL) {
|
||||||
|
pDevice->pContext->pVTable->onDeviceWakeup(pDevice);
|
||||||
|
}
|
||||||
|
|
||||||
ma_thread_wait(&pDevice->audioThread);
|
ma_thread_wait(&pDevice->audioThread);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user