From cde21de5c56b218e9f9d0e5a263e075cb1c72c37 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 Jun 2021 17:18:02 +1000 Subject: [PATCH] Fix a bug introduced in an earlier commit. --- research/miniaudio_engine.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/research/miniaudio_engine.h b/research/miniaudio_engine.h index ee090dea..da6359c5 100644 --- a/research/miniaudio_engine.h +++ b/research/miniaudio_engine.h @@ -7054,8 +7054,14 @@ done: } } - if ((flags & MA_DATA_SOURCE_FLAG_WAIT_INIT) != 0) { - ma_resource_manager_inline_notification_uninit(&initNotification); + /* + The init notification needs to be uninitialized. This will be used if the node does not already + exist, and we've specified ASYNC | WAIT_INIT. + */ + if (nodeAlreadyExists == MA_FALSE) { + if ((flags & MA_DATA_SOURCE_FLAG_ASYNC) != 0 && (flags & MA_DATA_SOURCE_FLAG_WAIT_INIT) != 0) { + ma_resource_manager_inline_notification_uninit(&initNotification); + } } *ppDataBufferNode = pDataBufferNode;