summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-03-16 20:37:59 -0700
committerEric Laurent <elaurent@google.com>2012-03-16 20:37:59 -0700
commit10c3fc89a458d8cafc82fcae7d58f661cd822ba7 (patch)
tree816303c0f4b450fd063be20555501741b1569839 /services
parent2b056c6e6759d63045c22556c5418a08fcb3f80c (diff)
downloadframeworks_base-10c3fc89a458d8cafc82fcae7d58f661cd822ba7.zip
frameworks_base-10c3fc89a458d8cafc82fcae7d58f661cd822ba7.tar.gz
frameworks_base-10c3fc89a458d8cafc82fcae7d58f661cd822ba7.tar.bz2
audioflinger: fix issue with camcorder and A2DP
Some audio HALs do not support well a device selection of 0 (no device) received on an input stream. This can happen because of a problem in the audioflinger code that handles the forwarding of the output device selection to the record thread for use by the pre processing modules that need it. If the output device is 0 (meaning no op, which happens when stopping playback over A2DP) audioflinger could not detect it was an output device selection and would forward it to the input stream (see AudioFlinger::setParameters() and RecordThread::checkForNewParameters_l(). Issue 6179641. Change-Id: Idae534521866538e0d12ba259a2834f402a922e2
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index ce701ca..05d6d72 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -794,7 +794,8 @@ status_t AudioFlinger::setParameters(int ioHandle, const String8& keyValuePairs)
// indicate output device change to all input threads for pre processing
AudioParameter param = AudioParameter(keyValuePairs);
int value;
- if (param.getInt(String8(AudioParameter::keyRouting), value) == NO_ERROR) {
+ if ((param.getInt(String8(AudioParameter::keyRouting), value) == NO_ERROR) &&
+ (value != 0)) {
for (size_t i = 0; i < mRecordThreads.size(); i++) {
mRecordThreads.valueAt(i)->setParameters(keyValuePairs);
}