From 9ed296b3b9f5a80f741ba2ad67067f61d5e35ba0 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 30 Jun 2021 20:58:43 +1000 Subject: [PATCH] Fix a bug where custom decoding backends aren't being used. --- research/miniaudio_engine.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/research/miniaudio_engine.h b/research/miniaudio_engine.h index 3ba86729..2ecbfe77 100644 --- a/research/miniaudio_engine.h +++ b/research/miniaudio_engine.h @@ -7045,7 +7045,10 @@ static ma_result ma_resource_manager_data_buffer_init_connector(ma_resource_mana { ma_decoder_config configOut; configOut = ma_decoder_config_init(pDataBuffer->pResourceManager->config.decodedFormat, pDataBuffer->pResourceManager->config.decodedChannels, pDataBuffer->pResourceManager->config.decodedSampleRate); - configOut.allocationCallbacks = pDataBuffer->pResourceManager->config.allocationCallbacks; + configOut.allocationCallbacks = pDataBuffer->pResourceManager->config.allocationCallbacks; + configOut.ppCustomBackendVTables = pDataBuffer->pResourceManager->config.ppCustomDecodingBackendVTables; + configOut.customBackendVTableCount = pDataBuffer->pResourceManager->config.customDecodingBackendVTableCount; + configOut.pCustomBackendUserData = pDataBuffer->pResourceManager->config.pCustomDecodingBackendUserData; result = ma_decoder_init_memory(pDataBuffer->pNode->data.encoded.pData, pDataBuffer->pNode->data.encoded.sizeInBytes, &configOut, &pDataBuffer->connector.decoder); } break; @@ -12508,6 +12511,10 @@ MA_API ma_result ma_engine_play_sound_ex(ma_engine* pEngine, const char* pFilePa } ma_mutex_unlock(&pEngine->inlinedSoundLock); + if (result != MA_SUCCESS) { + return result; + } + /* Finally we can start playing the sound. */ result = ma_sound_start(&pSound->sound); if (result != MA_SUCCESS) {