From e541269be94f3a1072932d51537905b120ef4733 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Fri, 16 May 2014 11:25:07 -0700 Subject: Use new channel count functions for audio masks Change-Id: Ia658ab4b6320d19fdb50f123c930918724ff0ef3 Signed-off-by: Andy Hung --- services/audioflinger/Tracks.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'services/audioflinger/Tracks.cpp') 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) { -- cgit v1.1