Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a621a144 authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan
Browse files

EqualizerView: don't compute log(0)

Because log(0) is undefined (turns out to be -2147483008.000000)
and that crashses on 480x800 hdpi

Change-Id: I41956944497c83214ee8e8378bc0924171633f21
parent 40030b0a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ public class EqualizerView extends VisualizerView {
                byte rfk = data.bytes[mDivisions * i];
                byte ifk = data.bytes[mDivisions * i + 1];
                float magnitude = (rfk * rfk + ifk * ifk);
                int dbValue = (int) (10 * Math.log10(magnitude));
                int dbValue = magnitude > 0 ? (int) (10 * Math.log10(magnitude)) : 0;

                mFFTPoints[i * 4 + 1] = rect.height();
                mFFTPoints[i * 4 + 3] = rect.height() - (dbValue * mDbFuzzFactor + mDbFuzz);