Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1590)

Unified Diff: Source/modules/webaudio/AudioBufferSourceNode.cpp

Issue 363613003: Removing using declarations that import names in the C++ Standard library. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/modules/webaudio/AudioNodeInput.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioBufferSourceNode.cpp
diff --git a/Source/modules/webaudio/AudioBufferSourceNode.cpp b/Source/modules/webaudio/AudioBufferSourceNode.cpp
index dc55f76d4d63b8a2b3f37d39d48124071619c55b..09f4fb975d24228e062236b44d0f22ffddb78e21 100644
--- a/Source/modules/webaudio/AudioBufferSourceNode.cpp
+++ b/Source/modules/webaudio/AudioBufferSourceNode.cpp
@@ -38,8 +38,6 @@
#include "wtf/MathExtras.h"
#include <algorithm>
-using namespace std;
-
namespace WebCore {
const double DefaultGrainDuration = 0.020; // 20ms
@@ -226,7 +224,7 @@ bool AudioBufferSourceNode::renderFromBuffer(AudioBus* bus, unsigned destination
double loopStartFrame = m_loopStart * buffer()->sampleRate();
double loopEndFrame = m_loopEnd * buffer()->sampleRate();
- virtualEndFrame = min(loopEndFrame, virtualEndFrame);
+ virtualEndFrame = std::min(loopEndFrame, virtualEndFrame);
virtualDeltaFrames = virtualEndFrame - loopStartFrame;
}
@@ -256,8 +254,8 @@ bool AudioBufferSourceNode::renderFromBuffer(AudioBus* bus, unsigned destination
endFrame = static_cast<unsigned>(virtualEndFrame);
while (framesToProcess > 0) {
int framesToEnd = endFrame - readIndex;
- int framesThisTime = min(framesToProcess, framesToEnd);
- framesThisTime = max(0, framesThisTime);
+ int framesThisTime = std::min(framesToProcess, framesToEnd);
+ framesThisTime = std::max(0, framesThisTime);
for (unsigned i = 0; i < numberOfChannels; ++i)
memcpy(destinationChannels[i] + writeIndex, sourceChannels[i] + readIndex, sizeof(float) * framesThisTime);
@@ -392,14 +390,14 @@ void AudioBufferSourceNode::start(double when, double grainOffset, double grainD
// Do sanity checking of grain parameters versus buffer size.
double bufferDuration = buffer()->duration();
- grainOffset = max(0.0, grainOffset);
- grainOffset = min(bufferDuration, grainOffset);
+ grainOffset = std::max(0.0, grainOffset);
+ grainOffset = std::min(bufferDuration, grainOffset);
m_grainOffset = grainOffset;
double maxDuration = bufferDuration - grainOffset;
- grainDuration = max(0.0, grainDuration);
- grainDuration = min(maxDuration, grainDuration);
+ grainDuration = std::max(0.0, grainDuration);
+ grainDuration = std::min(maxDuration, grainDuration);
m_grainDuration = grainDuration;
m_isGrain = true;
@@ -431,10 +429,10 @@ double AudioBufferSourceNode::totalPitchRate()
double totalRate = dopplerRate * sampleRateFactor * basePitchRate;
// Sanity check the total rate. It's very important that the resampler not get any bad rate values.
- totalRate = max(0.0, totalRate);
+ totalRate = std::max(0.0, totalRate);
if (!totalRate)
totalRate = 1; // zero rate is considered illegal
- totalRate = min(MaxRate, totalRate);
+ totalRate = std::min(MaxRate, totalRate);
bool isTotalRateValid = !std::isnan(totalRate) && !std::isinf(totalRate);
ASSERT(isTotalRateValid);
« no previous file with comments | « no previous file | Source/modules/webaudio/AudioNodeInput.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698