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

Commit 33897bac authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: fix beacon mute delay

Only take output latency into account when the output is active
when muting TTS stream. This avoid a systematic long delay the
first time we play audio due to first beacon mute state change.

Bug: 37923452
Test: repro steps in bug
Change-Id: I10b21a55c0fad28344108b67756f600a29e41fea
(cherry picked from commit cdb2b35c)
parent e52b8fa8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5648,7 +5648,7 @@ uint32_t AudioPolicyManager::setBeaconMute(bool mute) {
            sp<SwAudioOutputDescriptor> desc = mOutputs.valueAt(i);
            setVolumeSourceMute(ttsVolumeSource, mute/*on*/, desc, 0 /*delay*/, DeviceTypeSet());
            const uint32_t latency = desc->latency() * 2;
            if (latency > maxLatency) {
            if (desc->isActive(latency * 2) && latency > maxLatency) {
                maxLatency = latency;
            }
        }