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/Threads.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'services/audioflinger/Threads.cpp') diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 2d4e025..8d9ccd0 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -1730,7 +1730,7 @@ void AudioFlinger::PlaybackThread::readOutputParameters_l() LOG_ALWAYS_FATAL("HAL channel mask %#x not supported for mixed output; " "must be AUDIO_CHANNEL_OUT_STEREO", mChannelMask); } - mChannelCount = popcount(mChannelMask); + mChannelCount = audio_channel_count_from_out_mask(mChannelMask); mFormat = mOutput->stream->common.get_format(&mOutput->stream->common); if (!audio_is_valid_format(mFormat)) { LOG_ALWAYS_FATAL("HAL format %#x not valid for output", mFormat); @@ -5564,8 +5564,8 @@ bool AudioFlinger::RecordThread::checkForNewParameter_l(const String8& keyValueP reqFormat == AUDIO_FORMAT_PCM_16_BIT && (mInput->stream->common.get_sample_rate(&mInput->stream->common) <= (2 * samplingRate)) && - popcount(mInput->stream->common.get_channels(&mInput->stream->common)) - <= FCC_2 && + audio_channel_count_from_in_mask( + mInput->stream->common.get_channels(&mInput->stream->common)) <= FCC_2 && (channelMask == AUDIO_CHANNEL_IN_MONO || channelMask == AUDIO_CHANNEL_IN_STEREO)) { status = NO_ERROR; @@ -5619,7 +5619,7 @@ void AudioFlinger::RecordThread::readInputParameters_l() { mSampleRate = mInput->stream->common.get_sample_rate(&mInput->stream->common); mChannelMask = mInput->stream->common.get_channels(&mInput->stream->common); - mChannelCount = popcount(mChannelMask); + mChannelCount = audio_channel_count_from_in_mask(mChannelMask); mFormat = mInput->stream->common.get_format(&mInput->stream->common); if (mFormat != AUDIO_FORMAT_PCM_16_BIT) { ALOGE("HAL format %#x not supported; must be AUDIO_FORMAT_PCM_16_BIT", mFormat); -- cgit v1.1