summaryrefslogtreecommitdiff
path: root/dgedit/player.cc
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2014-05-02 13:04:58 +0200
committerJonas Suhr Christensen <jsc@umbraculum.org>2014-05-02 13:04:58 +0200
commit521eaad10b2b9b7104b2b55e66864b54577e7b54 (patch)
tree81a446304a1996baa7544adaa0ca0be721d63a72 /dgedit/player.cc
parent6fa22c8eab8cbae74079a344a759fbd179ed857e (diff)
Fixed peak reporting. Use fabs() not abs() when working with double!
Diffstat (limited to 'dgedit/player.cc')
-rw-r--r--dgedit/player.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/dgedit/player.cc b/dgedit/player.cc
index 64b3067..3a2bfd2 100644
--- a/dgedit/player.cc
+++ b/dgedit/player.cc
@@ -102,7 +102,9 @@ void Player::run()
sample = pcm_data[p] * fade * gain_scalar;
}
- if(abs(sample) > peak) peak = abs(sample);
+ if(fabs(sample) > peak) {
+ peak = fabs(sample);
+ }
s[i] = _MIN(sample * SHRT_MAX, SHRT_MAX);
}