Replace lrint(x) with static_cast(x+0.5)

Update 9 files

Update RageSoundReader_Extend.cpp
Update RageSoundReader_Preload.cpp
Update RageSoundUtil.cpp
Update RageSoundReader_ThreadedBuffer.cpp
Update RageSoundReader_SpeedChange.cpp
Update RageSoundReader_Resample_Good.cpp
Update RageSoundReader_Merge.cpp
Update RageSoundReader_Chain.cpp
Update RageSoundMixBuffer.cpp
This commit is contained in:
sukibaby
2024-05-03 18:28:17 -07:00
committed by teejusb
parent bd075c42a1
commit 2e2d49393b
9 changed files with 19 additions and 19 deletions
+2 -2
View File
@@ -623,7 +623,7 @@ void RageSoundReader_Resample_Good::ReopenResampler()
}
if( m_fRate != -1 )
iDownFactor = std::lrint( m_fRate * iDownFactor );
iDownFactor = static_cast<int>((m_fRate * iDownFactor) + 0.5 );
for( std::size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel )
m_apResamplers[iChannel]->SetDownFactor( iDownFactor );
@@ -699,7 +699,7 @@ void RageSoundReader_Resample_Good::SetRate( float fRatio )
int iDownFactor, iUpFactor;
GetFactors( iDownFactor, iUpFactor );
if( m_fRate != -1 )
iDownFactor = std::lrint( m_fRate * iDownFactor );
iDownFactor = static_cast<int>((m_fRate * iDownFactor) + 0.5 );
/* Set m_fRate to the actual rate, after quantization by iUpFactor. */
m_fRate = float(iDownFactor) / iUpFactor;