diff options
author | Jaideep Sharma <quic_jaidshar@quicinc.com> | 2024-05-02 12:43:26 +0530 |
---|---|---|
committer | Jaideep Sharma <quic_jaidshar@quicinc.com> | 2024-05-02 12:48:39 +0530 |
commit | f4fc9eefcbf2b7fc9758686f12e3417edafbe368 (patch) | |
tree | 6e8a1ec4331be18847e5a4376a93f17ce340b3c3 | |
parent | 6f32f6146d97de73cc5264259169b5b29d1e3fa7 (diff) | |
download | av-f4fc9eefcbf2b7fc9758686f12e3417edafbe368.tar.gz |
av: Fix volume count sent to HAL
Use audio_channel_count_from_out_mask to properly calculate the
channel count from the mask, so a valid volume array can be
sent to audio hal.
Test: play a clip check volume array sent to hal
Bug: 326853618
Change-Id: I59b815f8f4eb16b4aeb2941330b023320adf95e2
-rw-r--r-- | media/libaudiohal/impl/StreamHalAidl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libaudiohal/impl/StreamHalAidl.cpp b/media/libaudiohal/impl/StreamHalAidl.cpp index 70e7949491..9d404a0d56 100644 --- a/media/libaudiohal/impl/StreamHalAidl.cpp +++ b/media/libaudiohal/impl/StreamHalAidl.cpp @@ -620,7 +620,7 @@ status_t StreamOutHalAidl::getLatency(uint32_t *latency) { status_t StreamOutHalAidl::setVolume(float left, float right) { TIME_CHECK(); if (!mStream) return NO_INIT; - size_t channelCount = audio_channel_out_mask_from_count(mConfig.channel_mask); + size_t channelCount = audio_channel_count_from_out_mask(mConfig.channel_mask); if (channelCount == 0) channelCount = 2; std::vector<float> volumes(channelCount); if (channelCount == 1) { |