From 4cbe200b85364c0b8590f721f44e9aad0c446c83 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 4 Dec 2020 18:07:11 +1000 Subject: [PATCH] Use an atomic load on the master volume. --- miniaudio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index b0881162..fdea7c26 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -11305,7 +11305,7 @@ static void ma_device__on_data(ma_device* pDevice, void* pFramesOut, const void* { float masterVolumeFactor; - masterVolumeFactor = pDevice->masterVolumeFactor; + ma_device_get_master_volume(pDevice, &masterVolumeFactor); /* Use ma_device_get_master_volume() to ensure the volume is loaded atomically. */ if (pDevice->onData) { if (!pDevice->noPreZeroedOutputBuffer && pFramesOut != NULL) {