summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.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/AudioFlinger.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/AudioFlinger.cpp')
-rw-r--r--services/audioflinger/AudioFlinger.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 11170c2..45e17f8 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1837,7 +1837,8 @@ audio_io_handle_t AudioFlinger::openInput(audio_module_handle_t module,
if (status == BAD_VALUE &&
reqFormat == config.format && config.format == AUDIO_FORMAT_PCM_16_BIT &&
(config.sample_rate <= 2 * reqSamplingRate) &&
- (popcount(config.channel_mask) <= FCC_2) && (popcount(reqChannelMask) <= FCC_2)) {
+ (audio_channel_count_from_in_mask(config.channel_mask) <= FCC_2) &&
+ (audio_channel_count_from_in_mask(reqChannelMask) <= FCC_2)) {
// FIXME describe the change proposed by HAL (save old values so we can log them here)
ALOGV("openInput() reopening with proposed sampling rate and channel mask");
inStream = NULL;
@@ -1857,7 +1858,8 @@ audio_io_handle_t AudioFlinger::openInput(audio_module_handle_t module,
TEE_SINK_OLD, // copy input using an existing pipe
} kind;
NBAIO_Format format = Format_from_SR_C(inStream->common.get_sample_rate(&inStream->common),
- popcount(inStream->common.get_channels(&inStream->common)));
+ audio_channel_count_from_in_mask(
+ inStream->common.get_channels(&inStream->common)));
if (!mTeeSinkInputEnabled) {
kind = TEE_SINK_NO;
} else if (!Format_isValid(format)) {