diff options
author | Andy Hung <hunga@google.com> | 2014-05-16 11:25:07 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2014-05-16 15:05:05 -0700 |
commit | e541269be94f3a1072932d51537905b120ef4733 (patch) | |
tree | 39646def02d7230929eb85189f48b9193b8c23a0 /media/libmedia/AudioRecord.cpp | |
parent | 7c96d53a65085f42ac2b6d416cbc16fd36ed72ff (diff) | |
download | frameworks_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 'media/libmedia/AudioRecord.cpp')
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 5 |
1 files changed, 3 insertions, 2 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)) { |