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

Commit 60d15624 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

APM: Don't copy invalid gain value

Bug: 24775316
Change-Id: I0c439a78909c03ca2b0340c67bfb969de2283166
parent 3806ff2f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -911,9 +911,11 @@ void AudioPortConfig::toAudioPortConfig(struct audio_port_config *dstConfig,
    } else {
        dstConfig->format = AUDIO_FORMAT_INVALID;
    }
    if (dstConfig->config_mask & AUDIO_PORT_CONFIG_GAIN) {
    sp<AudioPort> audioport = getAudioPort();
    if ((dstConfig->config_mask & AUDIO_PORT_CONFIG_GAIN) && audioport != NULL) {
        dstConfig->gain = mGain;
        if ((srcConfig != NULL) && (srcConfig->config_mask & AUDIO_PORT_CONFIG_GAIN)) {
        if ((srcConfig != NULL) && (srcConfig->config_mask & AUDIO_PORT_CONFIG_GAIN)
                && audioport->checkGain(&srcConfig->gain, srcConfig->gain.index) == OK) {
            dstConfig->gain = srcConfig->gain;
        }
    } else {