Index: third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.cpp |
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.cpp |
index f4a86ca65181ee9dc233c803168a815022438191..a02406807862e9e17b8bd26b83f85bb59a341156 100644 |
--- a/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.cpp |
+++ b/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.cpp |
@@ -35,6 +35,7 @@ namespace blink { |
AudioDestinationHandler::AudioDestinationHandler(AudioNode& node, float sampleRate) |
: AudioHandler(NodeTypeDestination, node, sampleRate) |
, m_currentSampleFrame(0) |
+ , m_numberOfConnections(0) |
{ |
addInput(); |
} |
@@ -103,6 +104,14 @@ void AudioDestinationHandler::render(AudioBus* sourceBus, AudioBus* destinationB |
// Advance current sample-frame. |
size_t newSampleFrame = m_currentSampleFrame + numberOfFrames; |
releaseStore(&m_currentSampleFrame, newSampleFrame); |
+ |
+ // Update connection status. |
+ releaseStore(&m_numberOfConnections, input(0).numberOfRenderingConnections()); |
+} |
+ |
+unsigned AudioDestinationHandler::numberOfConnections() const |
+{ |
+ return acquireLoad(&m_numberOfConnections); |
} |
// ---------------------------------------------------------------- |
@@ -122,5 +131,10 @@ unsigned long AudioDestinationNode::maxChannelCount() const |
return audioDestinationHandler().maxChannelCount(); |
} |
+bool AudioDestinationNode::hasConnection() const |
+{ |
+ return audioDestinationHandler().numberOfConnections() > 0; |
+} |
Raymond Toy
2016/08/26 20:12:15
Since AudioDestinationNode is an AudioNode with a
hongchan
2016/08/27 17:09:40
As we discussed offline, this structure is necessa
|
+ |
} // namespace blink |