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

Commit 82741e48 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Fix 2 bugs in fast mixer statistics" into jb-dev

parents 7cf0de49 e58ccce4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
        }