diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-09-25 22:20:36 +0200 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-09-25 22:20:36 +0200 |
commit | 37945a355149048ac7bf4db29e122c891e8b92cc (patch) | |
tree | d9c28d51651b29abd661ca39c8aa3b971f178bb5 /src/engine | |
parent | 8c0426652595eeee50724d621e080a0070fddae3 (diff) |
engine/enginepregain: Fix remaining issues
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/enginepregain.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/engine/enginepregain.cpp b/src/engine/enginepregain.cpp index 27ed698219..35a71e0d6a 100644 --- a/src/engine/enginepregain.cpp +++ b/src/engine/enginepregain.cpp @@ -95,10 +95,10 @@ void EnginePregain::process(CSAMPLE* pInOut, const int iBufferSize) { // This means that a ReplayGain value has been calculated after the // track has been loaded - const double kFadeSeconds = 1.0; + const float kFadeSeconds = 1.0; if (m_bSmoothFade) { - double seconds = m_timer.elapsed().toDoubleSeconds(); + float seconds = static_cast<float>(m_timer.elapsed().toDoubleSeconds()); if (seconds < kFadeSeconds) { // Fade smoothly const float fadeFrac = seconds / kFadeSeconds; @@ -134,7 +134,10 @@ void EnginePregain::process(CSAMPLE* pInOut, const int iBufferSize) { // we do not add more gain then we found in the original track. // This compensates a negative ReplayGain or PreGain setting. - CSAMPLE_GAIN speedGain = log10((fabs(m_dSpeed) * kSpeedGainMultiplier) + 1) / kSpeedOneDiv; + CSAMPLE_GAIN speedGain = log10((fabs(static_cast<CSAMPLE_GAIN>(m_dSpeed)) * + kSpeedGainMultiplier) + + 1) / + kSpeedOneDiv; // Limit speed Gain to 0 dB if totalGain is already > 0.9 or Limit the // resulting totalGain to 0.9 for all other cases. This should avoid clipping even // if the source track has some samples above 1.0 due to lossy codecs. |