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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioParam.cpp

Issue 1377903002: Use frames instead of time for running AudioParam timelines. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
Index: third_party/WebKit/Source/modules/webaudio/AudioParam.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp b/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp
index 2d2eb9e133499f337487d4afde7eb6928352bf79..c135753167289e1e201753a72415a06825586728 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp
@@ -161,12 +161,12 @@ void AudioParamHandler::calculateTimelineValues(float* values, unsigned numberOf
// Calculate values for this render quantum. Normally numberOfValues will
// equal to AudioHandler::ProcessingSizeInFrames (the render quantum size).
double sampleRate = context()->sampleRate();
- double startTime = context()->currentTime();
- double endTime = startTime + numberOfValues / sampleRate;
+ size_t startFrame = context()->currentSampleFrame();
+ size_t endFrame = startFrame + numberOfValues;
// Note we're running control rate at the sample-rate.
// Pass in the current value as default value.
- m_value = m_timeline.valuesForTimeRange(startTime, endTime, narrowPrecisionToFloat(m_value), values, numberOfValues, sampleRate, sampleRate);
+ m_value = m_timeline.valuesForFrameRange(startFrame, endFrame, narrowPrecisionToFloat(m_value), values, numberOfValues, sampleRate, sampleRate);
}
void AudioParamHandler::connect(AudioNodeOutput& output)

Powered by Google App Engine
This is Rietveld 408576698