From 26e9eb620fa33bb1fa18803ae5cb35b92cd54673 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 25 Aug 2018 10:51:15 +1000 Subject: [PATCH] Potential fix for a bug where the audio format is not init'd properly. --- mini_al.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mini_al.h b/mini_al.h index 1154e9bb..e1bc3f1c 100644 --- a/mini_al.h +++ b/mini_al.h @@ -20078,9 +20078,11 @@ mal_thread_result MAL_THREADCALL mal_worker_thread(void* pData) mal_device__set_state(pDevice, MAL_STATE_UNINITIALIZED); reinitResult = pDevice->pContext->onDeviceInit(pDevice->pContext, pDevice->type, NULL, &pDevice->initConfig, pDevice); - if (reinitResult == MAL_SUCCESS) { - mal_device__post_init_setup(pDevice); - } + } + + // Perform the post initialization setup just in case the data conversion pipeline needs to be reinitialized. + if (reinitResult == MAL_SUCCESS) { + mal_device__post_init_setup(pDevice); } // If reinitialization was successful, loop back to the start.