summaryrefslogtreecommitdiffstats
path: root/include/media
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
commit9f6530f53ae9eda43f4e7c1cb30d2379db00aa00 (patch)
tree663430f29fec8c038ad2770e2640c9480c0e2251 /include/media
parentd2824a9a392e02a09929a34f0a3dad41ac1faacf (diff)
downloadframeworks_av-9f6530f53ae9eda43f4e7c1cb30d2379db00aa00.zip
frameworks_av-9f6530f53ae9eda43f4e7c1cb30d2379db00aa00.tar.gz
frameworks_av-9f6530f53ae9eda43f4e7c1cb30d2379db00aa00.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.h7
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;
};