diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-11-02 20:42:54 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-11-02 20:42:54 +0200 |
commit | b0764f5976dcb292f28e31eae5a08cd4ab900540 (patch) | |
tree | da8b9b1e4fc98916e7c749c4f9e73a1377bd154d /src/util | |
parent | 7693a70363fc3cbb48203638716a33a42516614a (diff) |
fix audio clipping on floating point formats
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/dsp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/dsp.c b/src/util/dsp.c index 62510b9..3b156d1 100644 --- a/src/util/dsp.c +++ b/src/util/dsp.c @@ -666,7 +666,7 @@ f32_to_adata(unsigned int x) */ if (e < 127 - (ADATA_BITS - 1)) y = 0; - else if (e > 127) + else if (e >= 127) y = ADATA_UNIT - 1; else y = m >> (127 + (32 - ADATA_BITS) - e); |