Commit c32971bb authored by Linus Lee's avatar Linus Lee Committed by Gerrit Code Review
Browse files

Merge "EqualizerView: don't compute log(0)" into cm-12.0

parents fe29ab1b a621a144
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment