Index: Source/modules/webaudio/MediaElementAudioSourceNode.cpp |
diff --git a/Source/modules/webaudio/MediaElementAudioSourceNode.cpp b/Source/modules/webaudio/MediaElementAudioSourceNode.cpp |
index e0812428868b5512fb97840db09ff06ab8a6941e..60361df71df07b20ac645c59a8477834b71094b8 100644 |
--- a/Source/modules/webaudio/MediaElementAudioSourceNode.cpp |
+++ b/Source/modules/webaudio/MediaElementAudioSourceNode.cpp |
@@ -33,6 +33,7 @@ |
#include "modules/webaudio/AudioNodeOutput.h" |
#include "platform/Logging.h" |
#include "platform/graphics/media/MediaPlayer.h" |
+#include "platform/weborigin/SecurityOrigin.h" |
#include "wtf/Locker.h" |
// These are somewhat arbitrary limits, but we need to do some kind of sanity-checking. |
@@ -123,6 +124,8 @@ void MediaElementAudioSourceNode::process(size_t numberOfFrames) |
MutexTryLocker tryLocker(m_processLock); |
if (tryLocker.locked()) { |
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); |
@@ -131,6 +134,9 @@ void MediaElementAudioSourceNode::process(size_t numberOfFrames) |
ASSERT(m_sourceSampleRate == sampleRate()); |
provider->provideInput(outputBus, numberOfFrames); |
} |
+ // Output silence if we don't have access to the element. |
+ if (!context()->securityOrigin()->canRequest(m_mediaElement->currentSrc())) |
+ outputBus->zero(); |
} else { |
// Either this port doesn't yet support HTMLMediaElement audio stream access, |
// or the stream is not yet available. |