use std max function for signal level meter update instead of if condition
This commit is contained in:
parent
4f91d59a96
commit
d089e7d308
1 changed files with 2 additions and 8 deletions
10
src/util.cpp
10
src/util.cpp
|
@ -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 );
|
||||||
|
|
Loading…
Reference in a new issue