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

Commit d571fab9 authored by Andy Hung's avatar Andy Hung
Browse files

AudioFlinger: Forward track port volume to patch tracks

Test:  atest AudioPlaybackCaptureTest (no apparent regressions)
Bug: 317212590
Flag: EXEMPT bugfix
Change-Id: Icff568f7764c9cf4752317707cac3c6e2121edfd
parent a78ebf01
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -225,9 +225,7 @@ public:
    void setInternalMute(bool muted) final { mInternalMute = muted; }

    // VolumePortInterface implementation
    void setPortVolume(float volume) override {
        mVolume = volume;
    }
    void setPortVolume(float volume) override;
    float getPortVolume() const override { return mVolume; }

protected:
@@ -414,7 +412,7 @@ private:
    std::unique_ptr<os::PersistableBundle> mMuteEventExtras;
    mute_state_t        mMuteState;
    bool                mInternalMute = false;
    float mVolume = 0.0f;
    std::atomic<float> mVolume = 0.0f;
};  // end of Track


+10 −0
Original line number Diff line number Diff line
@@ -1601,6 +1601,16 @@ status_t Track::selectPresentation(int presentationId,
    return INVALID_OPERATION;
}

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); });
    }
}

VolumeShaper::Status Track::applyVolumeShaper(
        const sp<VolumeShaper::Configuration>& configuration,
        const sp<VolumeShaper::Operation>& operation)