aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/backends/mmdevapi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c
index 13d63941..9e55c8ce 100644
--- a/Alc/backends/mmdevapi.c
+++ b/Alc/backends/mmdevapi.c
@@ -520,6 +520,9 @@ static HRESULT DoReset(ALCdevice *device)
if(SUCCEEDED(hr))
{
min_len = (UINT32)((min_per*device->Frequency + 10000000-1) / 10000000);
+ /* 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;
hr = IAudioClient_GetBufferSize(data->client, &buffer_len);
}
if(FAILED(hr))