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

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

Issue 1261643002: Remove unnecessary condition for audioSourceProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: change audioSourceProvider to return reference Created 5 years, 5 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
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/MediaElementAudioSourceNode.cpp
diff --git a/Source/modules/webaudio/MediaElementAudioSourceNode.cpp b/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
index 9fe281bf26980c0072fac55f03b1c8e61ae59acb..0efd897174cb955acd6d8ca58bab502dea9e7aca 100644
--- a/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
+++ b/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
@@ -163,35 +163,30 @@ void MediaElementAudioSourceHandler::process(size_t numberOfFrames)
outputBus->zero();
return;
}
- if (AudioSourceProvider* provider = mediaElement()->audioSourceProvider()) {
- // 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()) {
- ASSERT(m_sourceSampleRate != sampleRate());
- m_multiChannelResampler->process(provider, outputBus, numberOfFrames);
- } else {
- // Bypass the resampler completely if the source is at the context's sample-rate.
- ASSERT(m_sourceSampleRate == sampleRate());
- provider->provideInput(outputBus, numberOfFrames);
- }
- // Output silence if we don't have access to the element.
- if (!passesCORSAccessCheck()) {
- if (m_maybePrintCORSMessage) {
- // Print a CORS message, but just once for each change in the current media
- // element source, and only if we have a document to print to.
- m_maybePrintCORSMessage = false;
- if (context()->executionContext()) {
- context()->executionContext()->postTask(FROM_HERE,
- createCrossThreadTask(&MediaElementAudioSourceHandler::printCORSMessage,
- this,
- m_currentSrcString));
- }
+ AudioSourceProvider& provider = mediaElement()->audioSourceProvider();
+ // 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()) {
+ ASSERT(m_sourceSampleRate != sampleRate());
+ m_multiChannelResampler->process(&provider, outputBus, numberOfFrames);
+ } else {
+ // Bypass the resampler completely if the source is at the context's sample-rate.
+ ASSERT(m_sourceSampleRate == sampleRate());
+ provider.provideInput(outputBus, numberOfFrames);
+ }
+ // Output silence if we don't have access to the element.
+ if (!passesCORSAccessCheck()) {
+ if (m_maybePrintCORSMessage) {
+ // Print a CORS message, but just once for each change in the current media
+ // element source, and only if we have a document to print to.
+ m_maybePrintCORSMessage = false;
+ if (context()->executionContext()) {
+ context()->executionContext()->postTask(FROM_HERE,
+ createCrossThreadTask(&MediaElementAudioSourceHandler::printCORSMessage,
+ this,
+ m_currentSrcString));
}
- outputBus->zero();
}
- } else {
- // Either this port doesn't yet support HTMLMediaElement audio stream access,
- // or the stream is not yet available.
outputBus->zero();
}
} else {
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698