Index: Source/modules/webaudio/AudioBufferSourceNode.cpp |
diff --git a/Source/modules/webaudio/AudioBufferSourceNode.cpp b/Source/modules/webaudio/AudioBufferSourceNode.cpp |
index 98824d94f3470554897b98e1bc44f6c61ec698ba..39c30655e0e75e4b3b1eb898ce65a9e3d6759637 100644 |
--- a/Source/modules/webaudio/AudioBufferSourceNode.cpp |
+++ b/Source/modules/webaudio/AudioBufferSourceNode.cpp |
@@ -414,7 +414,7 @@ void AudioBufferSourceHandler::clampGrainParameters(const AudioBuffer* buffer) |
// grainDuration is larger than the buffer duration. The net effect is as if the user called |
// stop(when + grainDuration). |
m_grainDuration = clampTo(m_grainDuration, 0.0, std::numeric_limits<double>::infinity()); |
- m_endTime = m_startTime + m_grainDuration; |
+ setEndTime(startTime() + m_grainDuration); |
} else { |
m_grainDuration = clampTo(m_grainDuration, 0.0, bufferDuration - m_grainOffset); |
} |
@@ -495,7 +495,7 @@ void AudioBufferSourceHandler::startSource(double when, double grainOffset, doub |
// If |when| < currentTime, the source must start now according to the spec. |
// So just set startTime to currentTime in this case to start the source now. |
- m_startTime = std::max(when, context()->currentTime()); |
+ setStartTime(std::max(when, context()->currentTime())); |
if (buffer()) |
clampGrainParameters(buffer()); |
@@ -581,7 +581,7 @@ void AudioBufferSourceHandler::handleStoppableSourceNode() |
// ok. |
double actualDuration = buffer()->duration() / m_minPlaybackRate; |
- double stopTime = m_startTime + actualDuration; |
+ double stopTime = startTime() + actualDuration; |
// See crbug.com/478301. If a source node is started via start(), the source may not start |
// at that time but one quantum (128 frames) later. But we compute the stop time based on |