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

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

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Fixes to WebAudioDeviceImpl unit test. Created 3 years, 10 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/AudioNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp
index a59f547aa093f82e6fe236a8df751a305c2fc187..078da446c08fb4cec63721f03b0aaad226e13fa5 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp
@@ -45,7 +45,6 @@ AudioHandler::AudioHandler(NodeType nodeType, AudioNode& node, float sampleRate)
m_nodeType(NodeTypeUnknown),
m_node(&node),
m_context(node.context()),
- m_sampleRate(sampleRate),
m_lastProcessingTime(-1),
m_lastNonSilentTime(-1),
m_connectionRefCount(0),
@@ -323,10 +322,11 @@ void AudioHandler::processIfNecessary(size_t framesToProcess) {
pullInputs(framesToProcess);
bool silentInputs = inputsAreSilent();
- if (!silentInputs)
+ if (!silentInputs) {
m_lastNonSilentTime =
(context()->currentSampleFrame() + framesToProcess) /
- static_cast<double>(m_sampleRate);
+ static_cast<double>(context()->sampleRate());
+ }
if (silentInputs && propagatesSilence()) {
silenceOutputs();

Powered by Google App Engine
This is Rietveld 408576698