Resampler: Fix a bug where the LPF is not being applied.

This commit is contained in:
David Reid
2026-02-05 20:15:54 +10:00
parent 5ea8bbf701
commit 848025b9c0
+4 -4
View File
@@ -59254,7 +59254,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_s16_downsample(ma_linear
}
/* Filter. Do not apply filtering if sample rates are the same or else you'll get dangerous glitching. */
if (pResampler->inAdvanceInt == 1 && pResampler->inAdvanceFrac == 0) {
if (pResampler->inAdvanceInt != 1 || pResampler->inAdvanceFrac != 0) {
ma_lpf_process_pcm_frame_s16(&pResampler->lpf, pResampler->x1.s16, pResampler->x1.s16);
}
@@ -59345,7 +59345,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_s16_upsample(ma_linear_r
ma_linear_resampler_interpolate_frame_s16(pResampler, invSampleRateOut, pFramesOutS16);
/* Filter. Do not apply filtering if sample rates are the same or else you'll get dangerous glitching. */
if (pResampler->inAdvanceInt == 1 && pResampler->inAdvanceFrac == 0) {
if (pResampler->inAdvanceInt != 1 || pResampler->inAdvanceFrac != 0) {
ma_lpf_process_pcm_frame_s16(&pResampler->lpf, pFramesOutS16, pFramesOutS16);
}
@@ -59422,7 +59422,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32_downsample(ma_linear
}
/* Filter. Do not apply filtering if sample rates are the same or else you'll get dangerous glitching. */
if (pResampler->inAdvanceInt == 1 && pResampler->inAdvanceFrac == 0) {
if (pResampler->inAdvanceInt != 1 || pResampler->inAdvanceFrac != 0) {
ma_lpf_process_pcm_frame_f32(&pResampler->lpf, pResampler->x1.f32, pResampler->x1.f32);
}
@@ -59513,7 +59513,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32_upsample(ma_linear_r
ma_linear_resampler_interpolate_frame_f32(pResampler, invSampleRateOut, pFramesOutF32);
/* Filter. Do not apply filtering if sample rates are the same or else you'll get dangerous glitching. */
if (pResampler->inAdvanceInt == 1 && pResampler->inAdvanceFrac == 0) {
if (pResampler->inAdvanceInt != 1 || pResampler->inAdvanceFrac != 0) {
ma_lpf_process_pcm_frame_f32(&pResampler->lpf, pFramesOutF32, pFramesOutF32);
}