diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-09-25 17:05:32 +0200 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-09-25 17:12:30 +0200 |
commit | 14bbb1c900e108e586e36727f02799e8b2524173 (patch) | |
tree | e27c6ece3da924aa9b8972a199595541fc9fc262 | |
parent | 37fed29fecfd5f938fd49d022ece82bbe406deb2 (diff) |
engine/enginepregain: Make lossy type casts explicit
-rw-r--r-- | src/engine/enginepregain.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/engine/enginepregain.cpp b/src/engine/enginepregain.cpp index ee68846028..b0bd88e7cb 100644 --- a/src/engine/enginepregain.cpp +++ b/src/engine/enginepregain.cpp @@ -64,7 +64,7 @@ void EnginePregain::setSpeedAndScratching(double speed, bool scratching) { } void EnginePregain::process(CSAMPLE* pInOut, const int iBufferSize) { - const float fReplayGain = m_pCOReplayGain->get(); + const auto fReplayGain = static_cast<float>(m_pCOReplayGain->get()); float fReplayGainCorrection; if (!s_pEnableReplayGain->toBool() || m_pPassthroughEnabled->toBool()) { // Override replaygain value if passing through @@ -99,8 +99,9 @@ void EnginePregain::process(CSAMPLE* pInOut, const int iBufferSize) { if (seconds < kFadeSeconds) { // Fade smoothly double fadeFrac = seconds / kFadeSeconds; - fReplayGainCorrection = m_fPrevGain * (1.0 - fadeFrac) + - fadeFrac * fullReplayGainBoost; + fReplayGainCorrection = + static_cast<float>(m_fPrevGain * (1.0 - fadeFrac) + + fadeFrac * fullReplayGainBoost); } else { m_bSmoothFade = false; fReplayGainCorrection = fullReplayGainBoost; @@ -140,7 +141,7 @@ void EnginePregain::process(CSAMPLE* pInOut, const int iBufferSize) { } else { speedGain = math_min(kMaxTotalGainBySpeed / totalGain, speedGain); } - totalGain *= speedGain; + totalGain *= static_cast<CSAMPLE_GAIN>(speedGain); if ((m_dSpeed * m_dOldSpeed < 0) && m_scratching) { // direction changed, go though zero if scratching @@ -160,4 +161,3 @@ void EnginePregain::collectFeatures(GroupFeatureState* pGroupFeatures) const { pGroupFeatures->gain = m_pPotmeterPregain->get(); pGroupFeatures->has_gain = true; } - |