aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/wasapi.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-28 18:45:35 -0800
committerChris Robinson <[email protected]>2018-11-28 18:45:35 -0800
commit38f4a0cf2c7ffc359f88594a7728b275f7158636 (patch)
tree759c79bc8a0a27350169eb456e7c7bbcc3b62990 /Alc/backends/wasapi.cpp
parentc3c0a5022a4b9d429c90cd7e6f3fc1bd284efd24 (diff)
Avoid the update size going to 0 with a relatively large device period
Diffstat (limited to 'Alc/backends/wasapi.cpp')
-rw-r--r--Alc/backends/wasapi.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Alc/backends/wasapi.cpp b/Alc/backends/wasapi.cpp
index 3d6c3e8c..dfc91489 100644
--- a/Alc/backends/wasapi.cpp
+++ b/Alc/backends/wasapi.cpp
@@ -1040,7 +1040,7 @@ HRESULT ALCwasapiPlayback::resetProxy()
min_len = (UINT32)ScaleCeil(min_per, device->Frequency, REFTIME_PER_SEC);
/* Find the nearest multiple of the period size to the update size */
if(min_len < device->UpdateSize)
- min_len *= (device->UpdateSize + min_len/2)/min_len;
+ min_len *= maxu((device->UpdateSize + min_len/2) / min_len, 1u);
hr = mClient->GetBufferSize(&buffer_len);
}
if(FAILED(hr))