From ab25b09935a1bfaa770363d061949bcae68c96a2 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 16 Mar 2008 00:21:48 +0000 Subject: [PATCH] fixed peak-calculation for negative signal-values git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@795 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 3 +++ src/core/mixer.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 635969ec7..1dbd0fb55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-03-15 Tobias Doerffel + * src/core/mixer.cpp: + fixed peak-calculation for negative signal-values + * include/effect_view.h: * src/widgets/effect_view.cpp: - fixed random crashes when removing effect-views diff --git a/src/core/mixer.cpp b/src/core/mixer.cpp index ae7b06d37..b98a4fb82 100644 --- a/src/core/mixer.cpp +++ b/src/core/mixer.cpp @@ -741,6 +741,10 @@ float mixer::peakValueLeft( surroundSampleFrame * _ab, const f_cnt_t _frames ) { p = _ab[f][0]; } + else if( -_ab[f][0] > p ) + { + p = -_ab[f][0]; + } } return( p ); } @@ -757,6 +761,10 @@ float mixer::peakValueRight( surroundSampleFrame * _ab, const f_cnt_t _frames ) { p = _ab[f][1]; } + else if( -_ab[f][1] > p ) + { + p = -_ab[f][1]; + } } return( p ); }