diff options
| author | Eric Laurent <elaurent@google.com> | 2014-07-01 20:26:35 -0700 |
|---|---|---|
| committer | Eric Laurent <elaurent@google.com> | 2014-07-01 20:26:35 -0700 |
| commit | fad3107efcc2425755f203fd41a4f6b4a971acfb (patch) | |
| tree | 1871acf524f16af732bc67d4596f4737e5e1c734 /audio | |
| parent | 6872cdb1636a9740ca06bd0f0ab09b3fe49c63f3 (diff) | |
audio: fixed channel count determination from channel mask
Do not use popcount() to derive channel count from channel mask.
Bug: 15000850.
Change-Id: I478b4c4e0076c2fdf4b9e6c007f49a9da72931ba
Diffstat (limited to 'audio')
| -rw-r--r-- | audio/audio_hw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c index bcec532..ffad231 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -661,7 +661,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void* buffer, } /* Reduce number of channels, if necessary */ - if (popcount(out_get_channels(&stream->common)) > + if (audio_channel_count_from_out_mask(out_get_channels(&stream->common)) > (int)out->pcm_config->channels) { unsigned int i; @@ -1171,7 +1171,7 @@ static size_t adev_get_input_buffer_size(const struct audio_hw_device *dev, size = (pcm_config_in.period_size * config->sample_rate) / pcm_config_in.rate; size = ((size + 15) / 16) * 16; - return (size * popcount(config->channel_mask) * + return (size * audio_channel_count_from_in_mask(config->channel_mask) * audio_bytes_per_sample(config->format)); } |
