Loading services/audiopolicy/engineconfigurable/src/Stream.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -97,13 +97,13 @@ float Element<audio_stream_type_t>::volIndexToDb(device_category deviceCategory, if (it == mVolumeProfiles.end()) { ALOGE("%s: device category %d not found for stream %s", __FUNCTION__, deviceCategory, getName().c_str()); return 1.0f; return 0.0f; } const VolumeCurvePoints curve = mVolumeProfiles[deviceCategory]; if (curve.size() != Volume::VOLCNT) { ALOGE("%s: invalid profile for category %d and for stream %s", __FUNCTION__, deviceCategory, getName().c_str()); return 1.0f; return 0.0f; } // the volume index in the UI is relative to the min and max volume indices for this stream type Loading @@ -112,7 +112,7 @@ float Element<audio_stream_type_t>::volIndexToDb(device_category deviceCategory, if (mIndexMax - mIndexMin == 0) { ALOGE("%s: Invalid volume indexes Min=Max=%d", __FUNCTION__, mIndexMin); return 1.0f; return 0.0f; } int volIdx = (nbSteps * (indexInUi - mIndexMin)) / (mIndexMax - mIndexMin); Loading @@ -120,7 +120,7 @@ float Element<audio_stream_type_t>::volIndexToDb(device_category deviceCategory, // find what part of the curve this index volume belongs to, or if it's out of bounds int segment = 0; if (volIdx < curve[Volume::VOLMIN].mIndex) { // out of bounds return 0.0f; return VOLUME_MIN_DB; } else if (volIdx < curve[Volume::VOLKNEE1].mIndex) { segment = 0; } else if (volIdx < curve[Volume::VOLKNEE2].mIndex) { Loading @@ -128,7 +128,7 @@ float Element<audio_stream_type_t>::volIndexToDb(device_category deviceCategory, } else if (volIdx <= curve[Volume::VOLMAX].mIndex) { segment = 2; } else { // out of bounds return 1.0f; return 0.0f; } // linear interpolation in the attenuation table in dB Loading Loading
services/audiopolicy/engineconfigurable/src/Stream.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -97,13 +97,13 @@ float Element<audio_stream_type_t>::volIndexToDb(device_category deviceCategory, if (it == mVolumeProfiles.end()) { ALOGE("%s: device category %d not found for stream %s", __FUNCTION__, deviceCategory, getName().c_str()); return 1.0f; return 0.0f; } const VolumeCurvePoints curve = mVolumeProfiles[deviceCategory]; if (curve.size() != Volume::VOLCNT) { ALOGE("%s: invalid profile for category %d and for stream %s", __FUNCTION__, deviceCategory, getName().c_str()); return 1.0f; return 0.0f; } // the volume index in the UI is relative to the min and max volume indices for this stream type Loading @@ -112,7 +112,7 @@ float Element<audio_stream_type_t>::volIndexToDb(device_category deviceCategory, if (mIndexMax - mIndexMin == 0) { ALOGE("%s: Invalid volume indexes Min=Max=%d", __FUNCTION__, mIndexMin); return 1.0f; return 0.0f; } int volIdx = (nbSteps * (indexInUi - mIndexMin)) / (mIndexMax - mIndexMin); Loading @@ -120,7 +120,7 @@ float Element<audio_stream_type_t>::volIndexToDb(device_category deviceCategory, // find what part of the curve this index volume belongs to, or if it's out of bounds int segment = 0; if (volIdx < curve[Volume::VOLMIN].mIndex) { // out of bounds return 0.0f; return VOLUME_MIN_DB; } else if (volIdx < curve[Volume::VOLKNEE1].mIndex) { segment = 0; } else if (volIdx < curve[Volume::VOLKNEE2].mIndex) { Loading @@ -128,7 +128,7 @@ float Element<audio_stream_type_t>::volIndexToDb(device_category deviceCategory, } else if (volIdx <= curve[Volume::VOLMAX].mIndex) { segment = 2; } else { // out of bounds return 1.0f; return 0.0f; } // linear interpolation in the attenuation table in dB Loading