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

Commit 311d0133 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Allow volume setting only for offloadable effect for Offload"

parents 7b95c4c0 1f8df9ae
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1157,7 +1157,8 @@ void AudioFlinger::EffectChain::setVolumeForOutput_l(uint32_t left, uint32_t rig
{
    sp<ThreadBase> thread = mThread.promote();
    if (thread != 0 &&
        (thread->type() == ThreadBase::OFFLOAD || thread->type() == ThreadBase::DIRECT)) {
        (thread->type() == ThreadBase::OFFLOAD || thread->type() == ThreadBase::DIRECT) &&
        !isNonOffloadableEnabled_l()) {
        PlaybackThread *t = (PlaybackThread *)thread.get();
        float vol_l = (float)left / (1 << 24);
        float vol_r = (float)right / (1 << 24);
@@ -2552,6 +2553,11 @@ void AudioFlinger::EffectChain::checkSuspendOnEffectEnabled(const sp<EffectModul
bool AudioFlinger::EffectChain::isNonOffloadableEnabled()
{
    Mutex::Autolock _l(mLock);
    return isNonOffloadableEnabled_l();
}

bool AudioFlinger::EffectChain::isNonOffloadableEnabled_l()
{
    size_t size = mEffects.size();
    for (size_t i = 0; i < size; i++) {
        if (mEffects[i]->isEnabled() && !mEffects[i]->isOffloadable()) {
+1 −0
Original line number Diff line number Diff line
@@ -378,6 +378,7 @@ public:

    // At least one non offloadable effect in the chain is enabled
    bool isNonOffloadableEnabled();
    bool isNonOffloadableEnabled_l();

    void syncHalEffectsState();