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

Commit 26bdb495 authored by Wenjing Wu's avatar Wenjing Wu
Browse files

Modify the calculation method of the volume DB value.

When the volume range is 0~100 and the UI adjusts the volume to level 1,
the volume DB value calculated by the volume curve is VOLUME_MIN_DB. The
volume value obtained after DbToAmpl conversion is 0.0f, so the music is
silent.

Test: Play music at volume level 1.
Bug: 280972677
Change-Id: I1cab6ff7a28c8da03564812d76bc9be9c4acf295
parent 98a30a9a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ float VolumeCurve::volIndexToDb(int indexInUi, int volIndexMin, int volIndexMax)
        return mCurvePoints[nbCurvePoints - 1].mAttenuationInMb / 100.0f;
    }
    if (indexInUiPosition == 0) {
        if (indexInUiPosition != mCurvePoints[0].mIndex) {
        if ((size_t)volIdx != mCurvePoints[0].mIndex) {
            return VOLUME_MIN_DB; // out of bounds
        }
        return mCurvePoints[0].mAttenuationInMb / 100.0f;