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

Commit f417a01a authored by Eric Laurent's avatar Eric Laurent Committed by android-build-merger
Browse files

Merge "audioflinger: improve mmap stream volume" into oc-dev

am: 9ba03c88

Change-Id: Ia5ccfd7af9c2087e648fee002cc4e29f99184c62
parents 7dc9e283 9ba03c88
Loading
Loading
Loading
Loading
+16 −14
Original line number Diff line number Diff line
@@ -8296,9 +8296,8 @@ void AudioFlinger::MmapPlaybackThread::processVolume_l()
            mEffectChains[0]->setVolume_l(&vol, &vol);
            volume = (float)vol / (1 << 24);
        }

        mOutput->stream->setVolume(volume, volume);

        // Try to use HW volume control and fall back to SW control if not implemented
        if (mOutput->stream->setVolume(volume, volume) != NO_ERROR) {
            sp<MmapStreamCallback> callback = mCallback.promote();
            if (callback != 0) {
                int channelCount;
@@ -8312,6 +8311,9 @@ void AudioFlinger::MmapPlaybackThread::processVolume_l()
                    values.add(volume);
                }
                callback->onVolumeChanged(mChannelMask, values);
            } else {
                ALOGW("Could not set MMAP stream volume: no volume callback!");
            }
        }
    }
}