diff options
Diffstat (limited to 'Alc/backends')
-rw-r--r-- | Alc/backends/mmdevapi.c | 3 |
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)) |