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

Commit 2232e907 authored by Vlad Popa's avatar Vlad Popa
Browse files

Do not forward volume to secondary tracks

We need to define rules how the volume is managed by the secondary patch
tracks. For now we keep the unattenuated volume for the patch tracks and
do not forward any changes.

Created b/388241142 for tracking the rules for volume management when
capturing audio.

Flag: EXEMPT bugfix
Test: atest AudioPlaybackCaptureTest --iterations 10
Bug: 381505666
Change-Id: I8d2e4a6def203876075071b6584b4c7f9ff1ca3d
parent d7fbd841
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -1744,13 +1744,8 @@ status_t Track::selectPresentation(int presentationId,

void Track::setPortVolume(float volume) {
    mVolume = volume;
    if (mType != TYPE_PATCH) {
        // Do not recursively propagate a PatchTrack setPortVolume to
        // downstream PatchTracks.
        forEachTeePatchTrack_l([volume](const auto &patchTrack) {
            patchTrack->setPortVolume(volume);
        });
    }
    // for now the secondary patch tracks contain the unattenuated volume
    // TODO(b/388241142): use volume capture rules to forward the volume to its patch tracks
}

void Track::setPortMute(bool muted) {
@@ -1758,13 +1753,8 @@ void Track::setPortMute(bool muted) {
        return;
    }
    mMutedFromPort = muted;
    if (mType != TYPE_PATCH) {
        // Do not recursively propagate a PatchTrack setPortVolume to
        // downstream PatchTracks.
        forEachTeePatchTrack_l([muted](const auto &patchTrack) {
            patchTrack->setPortMute(muted);
        });
    }
    // for now the secondary patch tracks will always be not muted
    // TODO(b/388241142): use volume capture rules to forward the mute state to its patch tracks
}

VolumeShaper::Status Track::applyVolumeShaper(