Title: [93816] branches/chromium/835/Source/WebCore/webaudio/AudioContext.cpp
- Revision
- 93816
- Author
- [email protected]
- Date
- 2011-08-25 13:28:37 -0700 (Thu, 25 Aug 2011)
Log Message
Merge 91801 - AudioContext is not correctly accounting for hardware resources
https://bugs.webkit.org/show_bug.cgi?id=65217
BUG=94271
Review URL: http://codereview.chromium.org/7741029
Modified Paths
Diff
Modified: branches/chromium/835/Source/WebCore/webaudio/AudioContext.cpp (93815 => 93816)
--- branches/chromium/835/Source/WebCore/webaudio/AudioContext.cpp 2011-08-25 20:27:57 UTC (rev 93815)
+++ branches/chromium/835/Source/WebCore/webaudio/AudioContext.cpp 2011-08-25 20:28:37 UTC (rev 93816)
@@ -93,8 +93,6 @@
ASSERT(isMainThread());
if (s_hardwareContextCount >= MaxHardwareContexts)
return 0;
-
- ++s_hardwareContextCount;
return adoptRef(new AudioContext(document));
}
@@ -135,10 +133,6 @@
// It's not that useful to have a callback function for this since the audio thread automatically starts rendering on the graph
// when this has finished (see AudioDestinationNode).
m_hrtfDatabaseLoader = HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(sampleRate());
-
- // FIXME: for now default AudioContext does not need an explicit startRendering() call.
- // We may want to consider requiring it for symmetry with OfflineAudioContext
- m_destinationNode->startRendering();
}
// Constructor for offline (non-realtime) rendering.
@@ -194,9 +188,17 @@
ASSERT(!m_isAudioThreadFinished);
if (!m_isAudioThreadFinished) {
if (m_destinationNode.get()) {
- // This starts the audio thread. The destination node's provideInput() method will now be called repeatedly to render audio.
- // Each time provideInput() is called, a portion of the audio stream is rendered. Let's call this time period a "render quantum".
m_destinationNode->initialize();
+
+ if (!isOfflineContext()) {
+ // This starts the audio thread. The destination node's provideInput() method will now be called repeatedly to render audio.
+ // Each time provideInput() is called, a portion of the audio stream is rendered. Let's call this time period a "render quantum".
+ // NOTE: for now default AudioContext does not need an explicit startRendering() call from _javascript_.
+ // We may want to consider requiring it for symmetry with OfflineAudioContext.
+ m_destinationNode->startRendering();
+ ++s_hardwareContextCount;
+ }
+
}
m_isInitialized = true;
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes