summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Tracks.cpp
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-05-16 11:25:07 -0700
committerAndy Hung <hunga@google.com>2014-05-16 15:05:05 -0700
commite541269be94f3a1072932d51537905b120ef4733 (patch)
tree39646def02d7230929eb85189f48b9193b8c23a0 /services/audioflinger/Tracks.cpp
parent7c96d53a65085f42ac2b6d416cbc16fd36ed72ff (diff)
downloadframeworks_av-e541269be94f3a1072932d51537905b120ef4733.zip
frameworks_av-e541269be94f3a1072932d51537905b120ef4733.tar.gz
frameworks_av-e541269be94f3a1072932d51537905b120ef4733.tar.bz2
Use new channel count functions for audio masks
Change-Id: Ia658ab4b6320d19fdb50f123c930918724ff0ef3 Signed-off-by: Andy Hung <hunga@google.com>
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 6dc7f30..1d46f87 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -81,7 +81,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),
@@ -1849,7 +1851,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) {