From: Anton Baskanov <baskanov@gmail.com> --- dlls/dsound/fir.h | 2 ++ dlls/dsound/mixer.c | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/dsound/fir.h b/dlls/dsound/fir.h index f317d19ba3b..24d93645d12 100644 --- a/dlls/dsound/fir.h +++ b/dlls/dsound/fir.h @@ -87,6 +87,7 @@ int main() fprintf(stderr, "status %s\n", get_pm_status_str(output.status)); printf("static const int fir_len = %d;\n", fir_len); + printf("static const int fir_width = %d;\n", fir_width); printf("static const int fir_step = %d;\n", fir_step); printf("static const float fir[] = {"); for (i = 0; i < fir_len; ++i) @@ -104,6 +105,7 @@ int main() } */ static const int fir_len = 8193; +static const int fir_width = 64; static const int fir_step = 128; static const float fir[] = { 0.0000000000e+00, -2.2207222127e-04, 1.4025302043e-05, 1.3443390954e-05, diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index f0dff13dbee..a89ff021184 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -353,13 +353,11 @@ static void upsample(LONG64 freq_adjust_num, LONG64 freq_adjust_den, LONG64 freq 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 + fir_step - 1) / fir_step; - int j; float sum = 0.0; float* cache = &input[ipos]; - for (j = 0; j < fir_used; j++) + for (j = 0; j < fir_width; j++) sum += (fir[idx + j * fir_step] * (1.0f - rem) + fir[idx + j * fir_step + 1] * rem) * cache[j]; output[i] = sum; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10217