From: Anton Baskanov <baskanov@gmail.com> --- dlls/dsound/mixer.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 21bd6e4041c..f0dff13dbee 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -341,7 +341,7 @@ static void downsample(LONG64 freq_adjust_num, LONG64 freq_adjust_den, LONG64 fr } static void upsample(LONG64 freq_adjust_num, LONG64 freq_adjust_den, LONG64 freq_acc_start, - UINT dsbfirstep, UINT count, float *input, float *output) + UINT count, float *input, float *output) { UINT i; @@ -349,18 +349,18 @@ static void upsample(LONG64 freq_adjust_num, LONG64 freq_adjust_den, LONG64 freq LONG64 ipos_num = freq_acc_start + i * freq_adjust_num; UINT ipos = ipos_num / freq_adjust_den; - UINT idx_num = ipos_num % freq_adjust_den * dsbfirstep; - UINT idx = dsbfirstep - 1 - idx_num / freq_adjust_den; + UINT idx_num = ipos_num % freq_adjust_den * fir_step; + UINT idx = fir_step - 1 - idx_num / freq_adjust_den; float rem = 1.0f - idx_num % freq_adjust_den / (float)freq_adjust_den; - int fir_used = (fir_len - 1 - idx + dsbfirstep - 1) / dsbfirstep; + int fir_used = (fir_len - 1 - idx + fir_step - 1) / fir_step; int j; float sum = 0.0; float* cache = &input[ipos]; for (j = 0; j < fir_used; j++) - sum += (fir[idx + j * dsbfirstep] * (1.0f - rem) + fir[idx + j * dsbfirstep + 1] * rem) * cache[j]; + sum += (fir[idx + j * fir_step] * (1.0f - rem) + fir[idx + j * fir_step + 1] * rem) * cache[j]; output[i] = sum; } } @@ -372,8 +372,7 @@ static void resample(LONG64 freq_adjust_num, LONG64 freq_adjust_den, LONG64 freq downsample(freq_adjust_num, freq_adjust_den, freq_acc_start, dsbfirstep, firgain, count, input, output); else - upsample(freq_adjust_num, freq_adjust_den, freq_acc_start, dsbfirstep, count, input, - output); + upsample(freq_adjust_num, freq_adjust_den, freq_acc_start, count, input, output); } static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 *freqAccNum) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10217