dsound: Fix type conversion problems.
This commit is contained in:
parent
53a8746dcd
commit
c60583ab8b
|
@ -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){
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue