summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-11-20 21:18:32 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-20 21:18:32 +0000
commitf50db74f4efa2f689711bd2e2ff3d88b7426f107 (patch)
tree05bd59939746cfbd69298bf4f15d69396a18b22e
parent7966142a096c1d5d7386a42eaccc9aed5b4344b3 (diff)
parentec0eeafa8a7fd882e8206e9cf8c4c7e1db81857b (diff)
downloadframeworks_av-f50db74f4efa2f689711bd2e2ff3d88b7426f107.zip
frameworks_av-f50db74f4efa2f689711bd2e2ff3d88b7426f107.tar.gz
frameworks_av-f50db74f4efa2f689711bd2e2ff3d88b7426f107.tar.bz2
Merge "Fix format conversion in DuplicatingThread" into lmp-mr1-dev
-rw-r--r--services/audioflinger/Threads.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 71a6a73..0f11b34 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -4694,15 +4694,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;