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

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

Issue 2033503004: Avoid slow AudioParam automation path when possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 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
Index: third_party/WebKit/Source/modules/webaudio/GainNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/GainNode.cpp b/third_party/WebKit/Source/modules/webaudio/GainNode.cpp
index bada5970788b44c481b88a1e4286507de4adf35f..01b13808941f4918d0bb45477e5fb612e2b1ebdd 100644
--- a/third_party/WebKit/Source/modules/webaudio/GainNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/GainNode.cpp
@@ -67,6 +67,11 @@ void GainHandler::process(size_t framesToProcess)
float* gainValues = m_sampleAccurateGainValues.data();
m_gain->calculateSampleAccurateValues(gainValues, framesToProcess);
outputBus->copyWithSampleAccurateGainValuesFrom(*inputBus, gainValues, framesToProcess);
+ // Update m_lastGain so if the timeline ever ends, we get
+ // consistent data for the smoothing below. (Without this,
+ // m_lastGain was the last value before the timeline started
+ // procesing.
+ m_lastGain = gainValues[framesToProcess - 1];
}
} else {
// Apply the gain with de-zippering into the output bus.
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp ('k') | third_party/WebKit/Source/platform/audio/Biquad.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698