summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioPolicyService.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-03-09 07:19:17 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-09 07:19:17 -0800
commitb3dfcf483a96816fe2e949dd86fed26e52ad7404 (patch)
treeb059e5d7f968b48c5933d99ffd62fad8d6ff134c /services/audioflinger/AudioPolicyService.cpp
parenta19ffb656616feec70613ba67ddfe15a504a4e76 (diff)
parent81872a2ce65653ae980621ba2907da56a83ba9a7 (diff)
downloadframeworks_av-b3dfcf483a96816fe2e949dd86fed26e52ad7404.zip
frameworks_av-b3dfcf483a96816fe2e949dd86fed26e52ad7404.tar.gz
frameworks_av-b3dfcf483a96816fe2e949dd86fed26e52ad7404.tar.bz2
Merge "AudioPolicyService InputDesc minor cleanup"
Diffstat (limited to 'services/audioflinger/AudioPolicyService.cpp')
-rw-r--r--services/audioflinger/AudioPolicyService.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index 62768bf..d57326b 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -298,8 +298,7 @@ audio_io_handle_t AudioPolicyService::getInput(audio_source_t inputSource,
ssize_t idx = mInputs.indexOfKey(input);
InputDesc *inputDesc;
if (idx < 0) {
- inputDesc = new InputDesc();
- inputDesc->mSessionId = audioSession;
+ inputDesc = new InputDesc(audioSession);
mInputs.add(input, inputDesc);
} else {
inputDesc = mInputs.valueAt(idx);
@@ -358,7 +357,6 @@ void AudioPolicyService::releaseInput(audio_io_handle_t input)
}
InputDesc *inputDesc = mInputs.valueAt(index);
setPreProcessorEnabled(inputDesc, false);
- inputDesc->mEffects.clear();
delete inputDesc;
mInputs.removeItemsAt(index);
}
@@ -602,9 +600,9 @@ status_t AudioPolicyService::dumpPermissionDenial(int fd)
return NO_ERROR;
}
-void AudioPolicyService::setPreProcessorEnabled(InputDesc *inputDesc, bool enabled)
+void AudioPolicyService::setPreProcessorEnabled(const InputDesc *inputDesc, bool enabled)
{
- Vector<sp<AudioEffect> > fxVector = inputDesc->mEffects;
+ const Vector<sp<AudioEffect> > &fxVector = inputDesc->mEffects;
for (size_t i = 0; i < fxVector.size(); i++) {
fxVector.itemAt(i)->setEnabled(enabled);
}