diff options
author | Eric Laurent <elaurent@google.com> | 2011-08-30 10:18:54 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2011-08-30 10:19:38 -0700 |
commit | 05ce0941649c3cdd7f8034496719e607977fc005 (patch) | |
tree | 1e507788895e36bcd18b37cd109ec90e7c46d90c /include/media | |
parent | 2c5423da4e3b23c0381952da2671f05a7501f9af (diff) | |
download | frameworks_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 'include/media')
-rw-r--r-- | include/media/AudioSystem.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index e0d7898..6a15f6e 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -185,6 +185,10 @@ public: static status_t unregisterEffect(int id); static status_t setEffectEnabled(int id, bool enabled); + // clear stream to output mapping cache (gStreamOutputMap) + // and output configuration cache (gOutputs) + static void clearAudioConfigCache(); + static const sp<IAudioPolicyService>& get_audio_policy_service(); // ---------------------------------------------------------------------------- @@ -236,7 +240,8 @@ private: // mapping between stream types and outputs static DefaultKeyedVector<int, audio_io_handle_t> gStreamOutputMap; - // list of output descritor containing cached parameters (sampling rate, framecount, channel count...) + // list of output descriptors containing cached parameters + // (sampling rate, framecount, channel count...) static DefaultKeyedVector<audio_io_handle_t, OutputDescriptor *> gOutputs; }; |