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

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

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Fixes to WebAudioDeviceImpl unit test. 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/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.

Powered by Google App Engine
This is Rietveld 408576698