summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.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/Threads.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/Threads.cpp')
-rw-r--r--services/audioflinger/Threads.cpp8
1 files changed, 4 insertions, 4 deletions
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);