From 1a919c0590636cecd3abba0217158c717818a8ca Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 22 May 2021 17:54:26 +1000 Subject: [PATCH] Cleanup to previous commit. --- research/miniaudio_engine.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/research/miniaudio_engine.h b/research/miniaudio_engine.h index bedce953..10c24276 100644 --- a/research/miniaudio_engine.h +++ b/research/miniaudio_engine.h @@ -2017,10 +2017,7 @@ MA_API ma_result ma_gainer_process_pcm_frames(ma_gainer* pGainer, void* pFramesO /* Slow path. Need to interpolate the gain for each channel individually. */ /* We can allow the input and output buffers to be null in which case we'll just update the internal timer. */ - if (pFramesOut == NULL || pFramesIn == NULL) { - /* Fast path. Just update the internal timer. */ - } else { - /* Slow path. Need to interpolate the gain for each channel individually. */ + if (pFramesOut != NULL && pFramesIn != NULL) { float a = (float)pGainer->t / pGainer->config.smoothTimeInFrames; float d = 1.0f / pGainer->config.smoothTimeInFrames; @@ -2033,11 +2030,11 @@ MA_API ma_result ma_gainer_process_pcm_frames(ma_gainer* pGainer, void* pFramesO if (a > 1) { a = 1; } - } - - pGainer->t = ma_min(pGainer->t + frameCount, pGainer->config.smoothTimeInFrames); + } } + pGainer->t = ma_min(pGainer->t + frameCount, pGainer->config.smoothTimeInFrames); + #if 0 for (iFrame = 0; iFrame < frameCount; iFrame += 1) { /* We can allow the input and output buffers to be null in which case we'll just update the internal timer. */