summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-08-30 10:18:54 -0700
committerEric Laurent <elaurent@google.com>2011-08-30 10:19:38 -0700
commit05ce0941649c3cdd7f8034496719e607977fc005 (patch)
tree1e507788895e36bcd18b37cd109ec90e7c46d90c /services/audioflinger/AudioFlinger.h
parent2c5423da4e3b23c0381952da2671f05a7501f9af (diff)
downloadframeworks_base-05ce0941649c3cdd7f8034496719e607977fc005.zip
frameworks_base-05ce0941649c3cdd7f8034496719e607977fc005.tar.gz
frameworks_base-05ce0941649c3cdd7f8034496719e607977fc005.tar.bz2
226483: A2DP connected, but music out to speaker
When the A2DP headset is connected, there is a possible race condition when the audio tracks are moved from the mixer thread attached to the speaker output to the thread attached to A2DP output. As the request to clear the stream type to output mapping cache in the client process is asynchronous, it is possible that the flag indicating to the client audio track to re-create the IAudioTrack on the new thread is processed before the cache is invalidated. In this case, the track will be attached to the old thread and music will continue playing over the device speaker instead of being redirected to A2DP headset. Change-Id: Ib2ce1eb5320eaff83287b93779061bf4e7a330df
Diffstat (limited to 'services/audioflinger/AudioFlinger.h')
-rw-r--r--services/audioflinger/AudioFlinger.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 1141f6c..c64fd4f 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -751,14 +751,18 @@ private:
virtual uint32_t hasAudioSession(int sessionId);
virtual uint32_t getStrategyForSession_l(int sessionId);
+ void setStreamValid(int streamType, bool valid);
+
struct stream_type_t {
stream_type_t()
: volume(1.0f),
- mute(false)
+ mute(false),
+ valid(true)
{
}
float volume;
bool mute;
+ bool valid;
};
protected: