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/libnbaio | |
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/libnbaio')
-rw-r--r-- | media/libnbaio/AudioStreamInSource.cpp | 3 | ||||
-rw-r--r-- | media/libnbaio/AudioStreamOutSink.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/media/libnbaio/AudioStreamInSource.cpp b/media/libnbaio/AudioStreamInSource.cpp index af8f365..6aab48a 100644 --- a/media/libnbaio/AudioStreamInSource.cpp +++ b/media/libnbaio/AudioStreamInSource.cpp @@ -46,7 +46,8 @@ ssize_t AudioStreamInSource::negotiate(const NBAIO_Format offers[], size_t numOf uint32_t sampleRate = mStream->common.get_sample_rate(&mStream->common); audio_channel_mask_t channelMask = (audio_channel_mask_t) mStream->common.get_channels(&mStream->common); - mFormat = Format_from_SR_C(sampleRate, popcount(channelMask), streamFormat); + mFormat = Format_from_SR_C(sampleRate, + audio_channel_count_from_in_mask(channelMask), streamFormat); mFrameSize = Format_frameSize(mFormat); } return NBAIO_Source::negotiate(offers, numOffers, counterOffers, numCounterOffers); diff --git a/media/libnbaio/AudioStreamOutSink.cpp b/media/libnbaio/AudioStreamOutSink.cpp index c28d34d..0d5f935 100644 --- a/media/libnbaio/AudioStreamOutSink.cpp +++ b/media/libnbaio/AudioStreamOutSink.cpp @@ -43,7 +43,8 @@ ssize_t AudioStreamOutSink::negotiate(const NBAIO_Format offers[], size_t numOff uint32_t sampleRate = mStream->common.get_sample_rate(&mStream->common); audio_channel_mask_t channelMask = (audio_channel_mask_t) mStream->common.get_channels(&mStream->common); - mFormat = Format_from_SR_C(sampleRate, popcount(channelMask), streamFormat); + mFormat = Format_from_SR_C(sampleRate, + audio_channel_count_from_out_mask(channelMask), streamFormat); mFrameSize = Format_frameSize(mFormat); } return NBAIO_Sink::negotiate(offers, numOffers, counterOffers, numCounterOffers); |