diff options
author | Glenn Kasten <gkasten@google.com> | 2014-11-21 02:57:55 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-21 02:57:55 +0000 |
commit | 994242df089e1abbd7d1d21d8183b4ad32710948 (patch) | |
tree | f1d9f618e7bd1aab810cdcabb093356d48a8cea3 /services/audioflinger | |
parent | 8518168a1bdb81e56f4324a72224a724337a5844 (diff) | |
parent | c63c09738772133e9b20a7c8576ad116ff855ee2 (diff) | |
download | frameworks_av-994242df089e1abbd7d1d21d8183b4ad32710948.zip frameworks_av-994242df089e1abbd7d1d21d8183b4ad32710948.tar.gz frameworks_av-994242df089e1abbd7d1d21d8183b4ad32710948.tar.bz2 |
am c63c0973: am f50db74f: Merge "Fix format conversion in DuplicatingThread" into lmp-mr1-dev automerge: d48f1b6
* commit 'c63c09738772133e9b20a7c8576ad116ff855ee2':
Fix format conversion in DuplicatingThread
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/Threads.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index aef1844..a0fbe4c 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -4778,15 +4778,15 @@ void AudioFlinger::DuplicatingThread::threadLoop_sleepTime() ssize_t AudioFlinger::DuplicatingThread::threadLoop_write() { + // We convert the duplicating thread format to AUDIO_FORMAT_PCM_16_BIT + // for delivery downstream as needed. This in-place conversion is safe as + // AUDIO_FORMAT_PCM_16_BIT is smaller than any other supported format + // (AUDIO_FORMAT_PCM_8_BIT is not allowed here). + if (mFormat != AUDIO_FORMAT_PCM_16_BIT) { + memcpy_by_audio_format(mSinkBuffer, AUDIO_FORMAT_PCM_16_BIT, + mSinkBuffer, mFormat, writeFrames * mChannelCount); + } for (size_t i = 0; i < outputTracks.size(); i++) { - // We convert the duplicating thread format to AUDIO_FORMAT_PCM_16_BIT - // for delivery downstream as needed. This in-place conversion is safe as - // AUDIO_FORMAT_PCM_16_BIT is smaller than any other supported format - // (AUDIO_FORMAT_PCM_8_BIT is not allowed here). - if (mFormat != AUDIO_FORMAT_PCM_16_BIT) { - memcpy_by_audio_format(mSinkBuffer, AUDIO_FORMAT_PCM_16_BIT, - mSinkBuffer, mFormat, writeFrames * mChannelCount); - } outputTracks[i]->write(reinterpret_cast<int16_t*>(mSinkBuffer), writeFrames); } mStandby = false; |