summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-05-19 22:06:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-19 22:06:18 +0000
commitb4db73d022f3de3530bc2b3c9c831ccfdd1a2ead (patch)
tree76def5c5d352697b31806a6c0b842ef1a0bc8925 /media/libmedia
parent1e54e6dfc1bb8d33089ed8857f0f194e696f85e2 (diff)
parente541269be94f3a1072932d51537905b120ef4733 (diff)
downloadframeworks_av-b4db73d022f3de3530bc2b3c9c831ccfdd1a2ead.zip
frameworks_av-b4db73d022f3de3530bc2b3c9c831ccfdd1a2ead.tar.gz
frameworks_av-b4db73d022f3de3530bc2b3c9c831ccfdd1a2ead.tar.bz2
Merge "Use new channel count functions for audio masks"
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/AudioRecord.cpp5
-rw-r--r--media/libmedia/AudioTrack.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 97ab8f8..1c808d0 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -51,7 +51,8 @@ status_t AudioRecord::getMinFrameCount(
// We double the size of input buffer for ping pong use of record buffer.
// Assumes audio_is_linear_pcm(format)
- if ((*frameCount = (size * 2) / (popcount(channelMask) * audio_bytes_per_sample(format))) == 0) {
+ if ((*frameCount = (size * 2) / (audio_channel_count_from_in_mask(channelMask) *
+ audio_bytes_per_sample(format))) == 0) {
ALOGE("Unsupported configuration: sampleRate %u, format %#x, channelMask %#x",
sampleRate, format, channelMask);
return BAD_VALUE;
@@ -193,7 +194,7 @@ status_t AudioRecord::set(
return BAD_VALUE;
}
mChannelMask = channelMask;
- uint32_t channelCount = popcount(channelMask);
+ uint32_t channelCount = audio_channel_count_from_in_mask(channelMask);
mChannelCount = channelCount;
if (audio_is_linear_pcm(format)) {
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 120b28e..7d3ecc5 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -291,7 +291,7 @@ status_t AudioTrack::set(
return BAD_VALUE;
}
mChannelMask = channelMask;
- uint32_t channelCount = popcount(channelMask);
+ uint32_t channelCount = audio_channel_count_from_out_mask(channelMask);
mChannelCount = channelCount;
// AudioFlinger does not currently support 8-bit data in shared memory