Index: third_party/WebKit/Source/platform/audio/EqualPowerPanner.cpp |
diff --git a/third_party/WebKit/Source/platform/audio/EqualPowerPanner.cpp b/third_party/WebKit/Source/platform/audio/EqualPowerPanner.cpp |
index 707fe28c28e162f44faa7857f6e3ab98f186b1d1..41b150b8670c945876f7818e174e8d03d83a41cf 100644 |
--- a/third_party/WebKit/Source/platform/audio/EqualPowerPanner.cpp |
+++ b/third_party/WebKit/Source/platform/audio/EqualPowerPanner.cpp |
@@ -28,10 +28,11 @@ |
#include "platform/audio/EqualPowerPanner.h" |
-#include <algorithm> |
#include "platform/audio/AudioBus.h" |
#include "platform/audio/AudioUtilities.h" |
#include "wtf/MathExtras.h" |
+#include <algorithm> |
+#include <cmath> |
// Use a 50ms smoothing / de-zippering time-constant. |
const float SmoothingTimeConstant = 0.050f; |
@@ -70,8 +71,7 @@ void EqualPowerPanner::pan(double azimuth, double /*elevation*/, const AudioBus* |
return; |
// Clamp azimuth to allowed range of -180 -> +180. |
- azimuth = std::max(-180.0, azimuth); |
- azimuth = std::min(180.0, azimuth); |
+ azimuth = clampTo(azimuth, -180.0, 180.0); |
// Alias the azimuth ranges behind us to in front of us: |
// -90 -> -180 to -90 -> 0 and 90 -> 180 to 90 -> 0 |