From 848025b9c0ffe71aee77da1e509a21595aeaf9ee Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 5 Feb 2026 20:15:54 +1000 Subject: [PATCH] Resampler: Fix a bug where the LPF is not being applied. --- miniaudio.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index c20c9afc..2ada3796 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -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); }