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

Commit 61f9adf9 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "policy: Avoid unnecessary set_parameter calls" into av-userspace.lnx.1.0-dev.1.0

parents 13b99aa1 0b2c3778
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -1271,9 +1271,14 @@ status_t AudioPolicyManagerCustom::checkAndSetVolume(audio_stream_type_t stream,
#ifdef FM_POWER_OPT
    } else if (stream == AUDIO_STREAM_MUSIC && hasPrimaryOutput() &&
               outputDesc == mPrimaryOutput) {
        /* Avoid unnecessary set_parameter calls as it puts the primary
           outputs FastMixer in HOT_IDLE leading to breaks in audio */
        if (volumeDb != mPrevFMVolumeDb) {
            mPrevFMVolumeDb = volumeDb;
            AudioParameter param = AudioParameter();
            param.addFloat(String8("fm_volume"), Volume::DbToAmpl(volumeDb));
            mpClientInterface->setParameters(mPrimaryOutput->mIoHandle, param.toString(), delayMs);
        }
#endif /* FM_POWER_OPT end */
    }

@@ -2037,7 +2042,8 @@ AudioPolicyManagerCustom::AudioPolicyManagerCustom(AudioPolicyClientInterface *c
    : AudioPolicyManager(clientInterface),
      mHdmiAudioDisabled(false),
      mHdmiAudioEvent(false),
      mPrevPhoneState(0)
      mPrevPhoneState(0),
      mPrevFMVolumeDb(0.0f)
{
    char ssr_enabled[PROPERTY_VALUE_MAX] = {0};
    bool prop_ssr_enabled = false;
+1 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ private:
        // Used for record + playback concurrency
        bool mIsInputRequestOnProgress;
#endif
        float mPrevFMVolumeDb;
};

};