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

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

Issue 2186813003: Sub-sample accurate start of OscillatorNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust thresholds for Mac 10.11 (retina) Created 3 years, 11 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/AudioScheduledSourceNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp
index 5146ef347543a9a8ace1d942f87fb98078f3d2f7..8dc1532e1e312ce9d2ad9408498803c7d91526b4 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp
@@ -50,7 +50,8 @@ void AudioScheduledSourceHandler::updateSchedulingInfo(
size_t quantumFrameSize,
AudioBus* outputBus,
size_t& quantumFrameOffset,
- size_t& nonSilentFramesToProcess) {
+ size_t& nonSilentFramesToProcess,
+ double& startFrameOffset) {
DCHECK(outputBus);
if (!outputBus)
return;
@@ -94,6 +95,10 @@ void AudioScheduledSourceHandler::updateSchedulingInfo(
// Increment the active source count only if we're transitioning from
// SCHEDULED_STATE to PLAYING_STATE.
setPlaybackState(PLAYING_STATE);
+ // Determine the offset of the true start time from the starting frame.
+ startFrameOffset = m_startTime * sampleRate - startFrame;
+ } else {
+ startFrameOffset = 0;
}
quantumFrameOffset =

Powered by Google App Engine
This is Rietveld 408576698