From: Anton Baskanov <baskanov@gmail.com> --- dlls/dsound/dsound_private.h | 1 - dlls/dsound/mixer.c | 13 +++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 8a829c9f7c1..c7917304d80 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -146,7 +146,6 @@ struct IDirectSoundBufferImpl DSVOLUMEPAN volpan; DSBUFFERDESC dsbd; /* used for frequency conversion (PerfectPitch) */ - DWORD firstep; float firgain; LONG64 freqAdjustNum,freqAdjustDen; LONG64 freqAccNum; diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 1d7c133a8f3..b00421df0ed 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -118,17 +118,10 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb) ieee = TRUE; /** - * Recalculate FIR step and gain. - * - * firstep says how many points of the FIR exist per one - * sample in the secondary buffer. firgain specifies what - * to multiply the FIR output by in order to attenuate it correctly. + * Recalculate FIR gain, which specifies what to multiply the FIR + * output by in order to attenuate it correctly. */ - if (dsb->freqAdjustNum > dsb->freqAdjustDen) - dsb->firstep = fir_step * dsb->freqAdjustDen / dsb->freqAdjustNum; - else - dsb->firstep = fir_step; - dsb->firgain = (float)dsb->firstep / fir_step; + dsb->firgain = min(1.0f, dsb->freqAdjustDen / (float)dsb->freqAdjustNum); /* calculate the 10ms write lead */ dsb->writelead = (dsb->freq / 100) * dsb->pwfx->nBlockAlign; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10255