use std max function for signal level meter update instead of if condition

This commit is contained in:
Volker Fischer 2013-12-16 21:15:42 +00:00
parent 4f91d59a96
commit d089e7d308

View file

@ -48,16 +48,10 @@ void CStereoSignalLevelMeter::Update ( CVector<short>& vecsAudio )
for ( int i = 0; i < iStereoVecSize; i += 6 ) // 2 * 3 = 6 -> stereo for ( int i = 0; i < iStereoVecSize; i += 6 ) // 2 * 3 = 6 -> stereo
{ {
// left channel // left channel
if ( sMaxL < vecsAudio[i] ) sMaxL = std::max ( sMaxL, vecsAudio[i] );
{
sMaxL = vecsAudio[i];
}
// right channel // right channel
if ( sMaxR < vecsAudio[i + 1] ) sMaxR = std::max ( sMaxR, vecsAudio[i + 1] );
{
sMaxR = vecsAudio[i + 1];
}
} }
dCurLevelL = UpdateCurLevel ( dCurLevelL, sMaxL ); dCurLevelL = UpdateCurLevel ( dCurLevelL, sMaxL );