Commit 54ae032a authored by David Reid's avatar David Reid

Use atomics for getting/setting master volume.

Public issue https://github.com/mackron/miniaudio/issues/237
parent 2e23d863
......@@ -33655,7 +33655,7 @@ MA_API ma_result ma_device_set_master_volume(ma_device* pDevice, float volume)
return MA_INVALID_ARGS;
}
pDevice->masterVolumeFactor = volume;
c89atomic_exchange_f32(&pDevice->masterVolumeFactor, volume);
return MA_SUCCESS;
}
......@@ -33671,7 +33671,7 @@ MA_API ma_result ma_device_get_master_volume(ma_device* pDevice, float* pVolume)
return MA_INVALID_ARGS;
}
*pVolume = pDevice->masterVolumeFactor;
*pVolume = c89atomic_load_f32(pVolume);
return MA_SUCCESS;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment