summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-05-11 16:32:13 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-11 16:32:13 -0700
commit82741e48228a69d9ffdf7fd3278b6d2d5c0d48c4 (patch)
tree61816a676358ce061670bef1cc67c012e142d5af
parent7cf0de49dbdcb2da7d9bf9421f58adf442dfeaea (diff)
parente58ccce45598bcf4b4874b0e87cd1eb8d05ba9a9 (diff)
downloadframeworks_av-82741e48228a69d9ffdf7fd3278b6d2d5c0d48c4.zip
frameworks_av-82741e48228a69d9ffdf7fd3278b6d2d5c0d48c4.tar.gz
frameworks_av-82741e48228a69d9ffdf7fd3278b6d2d5c0d48c4.tar.bz2
Merge "Fix 2 bugs in fast mixer statistics" into jb-dev
-rw-r--r--services/audioflinger/FastMixer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp
index 1492a36..04d0f65 100644
--- a/services/audioflinger/FastMixer.cpp
+++ b/services/audioflinger/FastMixer.cpp
@@ -467,7 +467,7 @@ bool FastMixer::threadLoop()
#ifdef FAST_MIXER_STATISTICS
// advance the FIFO queue bounds
size_t i = bounds & (FastMixerDumpState::kSamplingN - 1);
- bounds = (bounds + 1) & 0xFFFF;
+ bounds = (bounds & 0xFFFF0000) | ((bounds + 1) & 0xFFFF);
if (full) {
bounds += 0x10000;
} else if (!(bounds & (FastMixerDumpState::kSamplingN - 1))) {
@@ -621,7 +621,7 @@ void FastMixerDumpState::dump(int fd)
loadNs.sample(sampleLoadNs);
kHz.sample(sampleCpukHz & ~0xF);
if (sampleCpukHz == previousCpukHz) {
- double megacycles = (double) sampleLoadNs * (double) sampleCpukHz;
+ double megacycles = (double) sampleLoadNs * (double) sampleCpukHz * 1e-12;
double adjMHz = megacycles / mixPeriodSec; // _not_ wallNs * 1e9
loadMHz.sample(adjMHz);
}