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

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

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Rebasing 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 c2c0dcf494ae24892e6a15eb1b67efcfa5f5487b..2d55fa2c12c7f306772ca4dd6503617b2b47a5f4 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