summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-04-11 18:37:33 -0700
committerGlenn Kasten <gkasten@google.com>2014-04-14 09:54:46 -0700
commitc125f38cd0ae35409a01b98a99e483550daa1313 (patch)
treeefee74222317630cd7e90c2d3c25867906030639 /services/audioflinger
parent27a17103f99d23157ac80ef7d75e25a3aae788bd (diff)
downloadframeworks_av-c125f38cd0ae35409a01b98a99e483550daa1313.zip
frameworks_av-c125f38cd0ae35409a01b98a99e483550daa1313.tar.gz
frameworks_av-c125f38cd0ae35409a01b98a99e483550daa1313.tar.bz2
audioflinger: forward device change to effects in direct thread
Device change during offload playback is not informed to effect chain which causes effects still work on unexpected output devices. Add device change notification in direct output thread. Original author wjiang <wjiang@codeaurora.org> CRs-Fixed: 630408 Bug: 14053172 Signed-off-by: Glenn Kasten <gkasten@google.com> Change-Id: I094a99bdf540479cee2fca6614ec35c2fa7d6046
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/Threads.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index feedd89..ae3dd8b 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3951,6 +3951,16 @@ bool AudioFlinger::DirectOutputThread::checkForNewParameters_l()
AudioParameter param = AudioParameter(keyValuePair);
int value;
+ if (param.getInt(String8(AudioParameter::keyRouting), value) == NO_ERROR) {
+ // forward device change to effects that have requested to be
+ // aware of attached audio device.
+ if (value != AUDIO_DEVICE_NONE) {
+ mOutDevice = value;
+ for (size_t i = 0; i < mEffectChains.size(); i++) {
+ mEffectChains[i]->setDevice_l(mOutDevice);
+ }
+ }
+ }
if (param.getInt(String8(AudioParameter::keyFrameCount), value) == NO_ERROR) {
// do not accept frame count changes if tracks are open as the track buffer
// size depends on frame count and correct behavior would not be garantied