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

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

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Updates based on reviewer comments. Created 4 years 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 216364574716eb7ff54797cfe985499ae703244f..5b01ff7fe9bdaa3747122d9541246a818188dcb4 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