diff options
author | Ramjee Singh <ramjee@codeaurora.org> | 2015-07-23 15:34:23 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:24:26 -0600 |
commit | 20f360507591a3802dd40aa37888c12714118025 (patch) | |
tree | 24c47da768b71c4dae4495b887a2a50362f734ac | |
parent | 1d29adc492f393919f81f431f2ee8eedba91561b (diff) | |
download | frameworks_av-20f360507591a3802dd40aa37888c12714118025.zip frameworks_av-20f360507591a3802dd40aa37888c12714118025.tar.gz frameworks_av-20f360507591a3802dd40aa37888c12714118025.tar.bz2 |
AudioFlinger: Invalidate offload track during SSR
-Offload track invalidation is needed during SSR
to switch from Offload to deep buffer playback.
Change-Id: I728cfcadc8cd734914b94000a711d1e86bcfad9d
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index 751c6b0..efb42c0 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -1053,9 +1053,24 @@ status_t AudioFlinger::setParameters(audio_io_handle_t ioHandle, const String8& } mHardwareStatus = AUDIO_HW_IDLE; } - // disable AEC and NS if the device is a BT SCO headset supporting those pre processings + AudioParameter param = AudioParameter(keyValuePairs); - String8 value; + String8 value, key; + key = String8("SND_CARD_STATUS"); + if (param.get(key, value) == NO_ERROR) { + ALOGV("Set keySoundCardStatus:%s", value.string()); + if ((value.find("OFFLINE", 0) != -1) ) { + ALOGV("OFFLINE detected - call InvalidateTracks()"); + for (size_t i = 0; i < mPlaybackThreads.size(); i++) { + PlaybackThread *thread = mPlaybackThreads.valueAt(i).get(); + if( thread->getOutput()->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD ){ + thread->invalidateTracks(AUDIO_STREAM_MUSIC); + } + } + } + } + + // disable AEC and NS if the device is a BT SCO headset supporting those pre processings if (param.get(String8(AUDIO_PARAMETER_KEY_BT_NREC), value) == NO_ERROR) { bool btNrecIsOff = (value == AUDIO_PARAMETER_VALUE_OFF); if (mBtNrecIsOff != btNrecIsOff) { |