| Index: third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp
|
| diff --git a/third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp b/third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp
|
| index 3231aa892a02b60ef29db46a48c46d58a084ed86..1615f3343799f6c862f17fe0324c3e69fcd1aeb4 100644
|
| --- a/third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp
|
| +++ b/third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp
|
| @@ -30,6 +30,8 @@
|
|
|
| #if ENABLE(WEB_AUDIO)
|
|
|
| +#include "wtf/MathExtras.h"
|
| +
|
| namespace blink {
|
|
|
| const int HRTFDatabase::MinElevation = -45;
|
| @@ -106,8 +108,7 @@ void HRTFDatabase::getKernelsFromAzimuthElevation(double azimuthBlend, unsigned
|
| unsigned HRTFDatabase::indexFromElevationAngle(double elevationAngle)
|
| {
|
| // Clamp to allowed range.
|
| - elevationAngle = std::max(static_cast<double>(MinElevation), elevationAngle);
|
| - elevationAngle = std::min(static_cast<double>(MaxElevation), elevationAngle);
|
| + elevationAngle = clampTo<double, double>(elevationAngle, MinElevation, MaxElevation);
|
|
|
| unsigned elevationIndex = static_cast<int>(InterpolationFactor * (elevationAngle - MinElevation) / RawElevationAngleSpacing);
|
| return elevationIndex;
|
|
|