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 = |