Index: third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp |
diff --git a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp |
index 594ccce8a929d43b0f8d316cf4f9ea7f1b20fd28..7d998904f03f97b81fd7f5beac40d0508fd9a403 100644 |
--- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp |
+++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp |
@@ -99,8 +99,8 @@ void MediaElementAudioSourceHandler::setFormat(size_t numberOfChannels, |
m_sourceNumberOfChannels = numberOfChannels; |
m_sourceSampleRate = sourceSampleRate; |
- if (sourceSampleRate != sampleRate()) { |
- double scaleFactor = sourceSampleRate / sampleRate(); |
+ if (sourceSampleRate != context()->sampleRate()) { |
+ double scaleFactor = sourceSampleRate / context()->sampleRate(); |
m_multiChannelResampler = |
WTF::makeUnique<MultiChannelResampler>(scaleFactor, numberOfChannels); |
} else { |
@@ -177,12 +177,12 @@ void MediaElementAudioSourceHandler::process(size_t numberOfFrames) { |
// Grab data from the provider so that the element continues to make |
// progress, even if we're going to output silence anyway. |
if (m_multiChannelResampler.get()) { |
- DCHECK_NE(m_sourceSampleRate, sampleRate()); |
+ DCHECK_NE(m_sourceSampleRate, context()->sampleRate()); |
m_multiChannelResampler->process(&provider, outputBus, numberOfFrames); |
} else { |
// Bypass the resampler completely if the source is at the context's |
// sample-rate. |
- DCHECK_EQ(m_sourceSampleRate, sampleRate()); |
+ DCHECK_EQ(m_sourceSampleRate, context()->sampleRate()); |
provider.provideInput(outputBus, numberOfFrames); |
} |
// Output silence if we don't have access to the element. |