mirror of
https://github.com/reactos/wine.git
synced 2025-02-15 02:18:51 +00:00
dsound: Fix fragment position calculations.
This commit is contained in:
parent
63490ce038
commit
ecd13dcbef
@ -788,7 +788,7 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force)
|
||||
device->pwqueue += prebuf_frags;
|
||||
|
||||
prebuf_frames = ((prebuf_frags + wave_fragpos > device->helfrags) ?
|
||||
(prebuf_frags + wave_fragpos - device->helfrags) :
|
||||
(device->helfrags - wave_fragpos) :
|
||||
(prebuf_frags)) * device->fraglen / device->pwfx->nBlockAlign;
|
||||
|
||||
hr = IAudioRenderClient_GetBuffer(device->render, prebuf_frames, &buffer);
|
||||
@ -859,8 +859,8 @@ static void DSOUND_PerformMix(DirectSoundDevice *device)
|
||||
return;
|
||||
}
|
||||
|
||||
pos_bytes = (clock_pos / (double)clock_freq) * device->pwfx->nSamplesPerSec *
|
||||
device->pwfx->nBlockAlign;
|
||||
pos_bytes = ceil(clock_pos * device->pwfx->nBlockAlign *
|
||||
(clock_freq / (double)device->pwfx->nSamplesPerSec));
|
||||
|
||||
delta_frags = (pos_bytes - device->last_pos_bytes) / device->fraglen;
|
||||
if(delta_frags > 0){
|
||||
|
Loading…
x
Reference in New Issue
Block a user