Round UpdateSize to the nearest multiple of MMDevAPI's period size

This commit is contained in:
Chris Robinson 2011-07-21 18:53:15 -07:00
parent 3d2812bd35
commit 0c8c3b16d2

View File

@ -496,7 +496,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device)
{
min_len = (min_per*device->Frequency + 10000000-1) / 10000000;
if(min_len < device->UpdateSize)
min_len *= device->UpdateSize/min_len;
min_len *= (device->UpdateSize + min_len/2)/min_len;
device->NumUpdates = (device->NumUpdates*device->UpdateSize + min_len/2) /
min_len;