summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-02-03 07:46:42 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-03 07:46:42 -0800
commit87f155d6655b2d3b27e69281a29e85c6407e4d26 (patch)
tree65032f39295f3fd280d8478bdc25a14b5362847d /services/audioflinger/AudioFlinger.cpp
parentf81e97e4ec8b01965a5b36987f886cf5001f71ff (diff)
parentd05397144be774f2f3623c754e865f51753e4e31 (diff)
downloadframeworks_av-87f155d6655b2d3b27e69281a29e85c6407e4d26.zip
frameworks_av-87f155d6655b2d3b27e69281a29e85c6407e4d26.tar.gz
frameworks_av-87f155d6655b2d3b27e69281a29e85c6407e4d26.tar.bz2
Merge "For performance, return large objects by reference"
Diffstat (limited to 'services/audioflinger/AudioFlinger.cpp')
-rw-r--r--services/audioflinger/AudioFlinger.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index b31040c..1a2fa66 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -7561,7 +7561,8 @@ void AudioFlinger::EffectChain::setEffectSuspendedAll_l(bool suspend)
ALOGV("setEffectSuspendedAll_l() add entry for 0");
}
if (desc->mRefCount++ == 0) {
- Vector< sp<EffectModule> > effects = getSuspendEligibleEffects();
+ Vector< sp<EffectModule> > effects;
+ getSuspendEligibleEffects(effects);
for (size_t i = 0; i < effects.size(); i++) {
setEffectSuspended_l(&effects[i]->desc().type, true);
}
@@ -7612,16 +7613,14 @@ bool AudioFlinger::EffectChain::isEffectEligibleForSuspend(const effect_descript
return true;
}
-Vector< sp<AudioFlinger::EffectModule> > AudioFlinger::EffectChain::getSuspendEligibleEffects()
+void AudioFlinger::EffectChain::getSuspendEligibleEffects(Vector< sp<AudioFlinger::EffectModule> > &effects)
{
- Vector< sp<EffectModule> > effects;
+ effects.clear();
for (size_t i = 0; i < mEffects.size(); i++) {
- if (!isEffectEligibleForSuspend(mEffects[i]->desc())) {
- continue;
+ if (isEffectEligibleForSuspend(mEffects[i]->desc())) {
+ effects.add(mEffects[i]);
}
- effects.add(mEffects[i]);
}
- return effects;
}
sp<AudioFlinger::EffectModule> AudioFlinger::EffectChain::getEffectIfEnabled(