summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Tracks.cpp
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-05-19 22:06:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-19 22:06:18 +0000
commitb4db73d022f3de3530bc2b3c9c831ccfdd1a2ead (patch)
tree76def5c5d352697b31806a6c0b842ef1a0bc8925 /services/audioflinger/Tracks.cpp
parent1e54e6dfc1bb8d33089ed8857f0f194e696f85e2 (diff)
parente541269be94f3a1072932d51537905b120ef4733 (diff)
downloadframeworks_av-b4db73d022f3de3530bc2b3c9c831ccfdd1a2ead.zip
frameworks_av-b4db73d022f3de3530bc2b3c9c831ccfdd1a2ead.tar.gz
frameworks_av-b4db73d022f3de3530bc2b3c9c831ccfdd1a2ead.tar.bz2
Merge "Use new channel count functions for audio masks"
Diffstat (limited to 'services/audioflinger/Tracks.cpp')
-rw-r--r--services/audioflinger/Tracks.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index 08687a2..de1782d 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -82,7 +82,9 @@ AudioFlinger::ThreadBase::TrackBase::TrackBase(
mSampleRate(sampleRate),
mFormat(format),
mChannelMask(channelMask),
- mChannelCount(popcount(channelMask)),
+ mChannelCount(isOut ?
+ audio_channel_count_from_out_mask(channelMask) :
+ audio_channel_count_from_in_mask(channelMask)),
mFrameSize(audio_is_linear_pcm(format) ?
mChannelCount * audio_bytes_per_sample(format) : sizeof(int8_t)),
mFrameCount(frameCount),
@@ -1850,7 +1852,7 @@ AudioFlinger::RecordThread::RecordTrack::RecordTrack(
mServerProxy = new AudioRecordServerProxy(mCblk, mBuffer, frameCount, mFrameSize);
- uint32_t channelCount = popcount(channelMask);
+ uint32_t channelCount = audio_channel_count_from_in_mask(channelMask);
// FIXME I don't understand either of the channel count checks
if (thread->mSampleRate != sampleRate && thread->mChannelCount <= FCC_2 &&
channelCount <= FCC_2) {