Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4fc9eef authored by Jaideep Sharma's avatar Jaideep Sharma
Browse files

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
parent 6f32f614
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {