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

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

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Add baseLatency and fix use of hardwareSampleRate. Created 4 years, 1 month 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 df8653550ec04ddea1bf6853eea3986a1df25fb0..b5f191a1a3a78b971ecdf2977f98f82520d3d103 100644
--- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
@@ -98,8 +98,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 =
makeUnique<MultiChannelResampler>(scaleFactor, numberOfChannels);
} else {
@@ -176,12 +176,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