Skip to content

Commit

Permalink
Recorder: Use Math.abs() instead of manually inverting sign
Browse files Browse the repository at this point in the history
Change-Id: I07b421d40939ad2fea93724933375d12b5ac3d6a
  • Loading branch information
luk1337 committed Oct 4, 2023
1 parent 12f51ca commit 4d384f8
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ private void recordingThreadImpl() {
if (status != 0) {
if (mTrackAmplitude.get()) {
for (int i = 0; i < status; i = i + 2) {
int value = data[i] & 0xff | data[i + 1] << 8;
if (value < 0) {
value = -value;
}
int value = Math.abs(data[i] & 0xff | data[i + 1] << 8);
if (mMaxAmplitude < value) {
mMaxAmplitude = value;
}
Expand Down

0 comments on commit 4d384f8

Please sign in to comment.