dsound: Fix type conversion problems.

This commit is contained in:
Andrew Eikum 2011-10-17 14:52:03 -05:00 committed by Alexandre Julliard
parent 53a8746dcd
commit c60583ab8b
2 changed files with 4 additions and 3 deletions

View File

@ -859,8 +859,8 @@ static void DSOUND_PerformMix(DirectSoundDevice *device)
return;
}
pos_bytes = ceil(clock_pos * device->pwfx->nBlockAlign *
(clock_freq / (double)device->pwfx->nSamplesPerSec));
pos_bytes = (clock_pos * device->pwfx->nBlockAlign * clock_freq) /
device->pwfx->nSamplesPerSec;
delta_frags = (pos_bytes - device->last_pos_bytes) / device->fraglen;
if(delta_frags > 0){

View File

@ -115,7 +115,8 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave)
}
prebuf_frames = device->prebuf * DSOUND_fraglen(device->pwfx->nSamplesPerSec, device->pwfx->nBlockAlign) / device->pwfx->nBlockAlign;
prebuf_rt = (prebuf_frames / (double)device->pwfx->nSamplesPerSec) * 10000000;
prebuf_rt = (10000000 * (UINT64)prebuf_frames) / device->pwfx->nSamplesPerSec;
hres = IAudioClient_Initialize(device->client,
AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST,
prebuf_rt, 50000, device->pwfx, NULL);