Minor adjustment to a calculation.

This commit is contained in:
David Reid
2025-02-17 09:30:40 +10:00
parent 017f8944d3
commit a6ac898663
+1 -1
View File
@@ -23169,7 +23169,7 @@ static ma_result ma_device_stop__wasapi_nolock(ma_device* pDevice)
*/ */
if (ma_atomic_bool32_get(&pDevice->wasapi.isStartedPlayback)) { if (ma_atomic_bool32_get(&pDevice->wasapi.isStartedPlayback)) {
/* We need to make sure we put a timeout here or else we'll risk getting stuck in a deadlock in some cases. */ /* We need to make sure we put a timeout here or else we'll risk getting stuck in a deadlock in some cases. */
DWORD waitTime = pDevice->wasapi.actualBufferSizeInFramesPlayback / (pDevice->playback.internalSampleRate / 1000); DWORD waitTime = (pDevice->wasapi.actualBufferSizeInFramesPlayback * 1000) / pDevice->playback.internalSampleRate;
if (pDevice->playback.shareMode == ma_share_mode_exclusive) { if (pDevice->playback.shareMode == ma_share_mode_exclusive) {
WaitForSingleObject((HANDLE)pDevice->wasapi.hEventPlayback, waitTime); WaitForSingleObject((HANDLE)pDevice->wasapi.hEventPlayback, waitTime);