diff options
author | Glenn Kasten <gkasten@google.com> | 2013-07-15 11:23:36 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2013-07-19 09:30:37 -0700 |
commit | 153b9fe667e6e78e0218ff0159353097428c7657 (patch) | |
tree | 360a76911071e362a94af32ccf67ce9619629708 /services/audioflinger/FastMixer.cpp | |
parent | 20f4754b7e687d3718a0a0a585f2c9ac22e2567d (diff) | |
download | frameworks_av-153b9fe667e6e78e0218ff0159353097428c7657.zip frameworks_av-153b9fe667e6e78e0218ff0159353097428c7657.tar.gz frameworks_av-153b9fe667e6e78e0218ff0159353097428c7657.tar.bz2 |
Make AudioFlinger::instantiate() more resilient when called from separate module
Bug: 8834855
Change-Id: I4cd842cdfb09d2aaaaab9df9ac3bec6179709bd3
Diffstat (limited to 'services/audioflinger/FastMixer.cpp')
-rw-r--r-- | services/audioflinger/FastMixer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp index 12e4683..819e8ec 100644 --- a/services/audioflinger/FastMixer.cpp +++ b/services/audioflinger/FastMixer.cpp @@ -25,6 +25,7 @@ #define ATRACE_TAG ATRACE_TAG_AUDIO +#include "Configuration.h" #include <sys/atomics.h> #include <time.h> #include <utils/Log.h> @@ -142,7 +143,9 @@ bool FastMixer::threadLoop() preIdle = *current; current = &preIdle; oldTsValid = false; +#ifdef FAST_MIXER_STATISTICS oldLoadValid = false; +#endif ignoreNextOverrun = true; } previous = current; @@ -182,8 +185,10 @@ bool FastMixer::threadLoop() warmupCycles = 0; sleepNs = -1; coldGen = current->mColdGen; +#ifdef FAST_MIXER_STATISTICS bounds = 0; full = false; +#endif oldTsValid = !clock_gettime(CLOCK_MONOTONIC, &oldTs); } else { sleepNs = FAST_HOT_IDLE_NS; @@ -614,6 +619,7 @@ FastMixerDumpState::FastMixerDumpState() : { mMeasuredWarmupTs.tv_sec = 0; mMeasuredWarmupTs.tv_nsec = 0; +#ifdef FAST_MIXER_STATISTICS // sample arrays aren't accessed atomically with respect to the bounds, // so clearing reduces chance for dumpsys to read random uninitialized samples memset(&mMonotonicNs, 0, sizeof(mMonotonicNs)); @@ -621,6 +627,7 @@ FastMixerDumpState::FastMixerDumpState() : #ifdef CPU_FREQUENCY_STATISTICS memset(&mCpukHz, 0, sizeof(mCpukHz)); #endif +#endif } FastMixerDumpState::~FastMixerDumpState() |