Bug 874952 - Always create enough last chunks for an engine, even if we don't end up calling into its ProduceAudioBlock function; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 23 May 2013 22:36:20 -0400
changeset 132826 71ade5bf04f1eb976e746540cee36666b2084e67
parent 132825 633a2ef5b0c2d58020a912c5f2ab26944f37b88d
child 132827 454f2e5ff75fd717ca8fab2098e862380070f654
push id28481
push usereakhgari@mozilla.com
push dateFri, 24 May 2013 02:36:28 +0000
treeherdermozilla-inbound@71ade5bf04f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs874952
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 874952 - Always create enough last chunks for an engine, even if we don't end up calling into its ProduceAudioBlock function; r=roc
content/media/AudioNodeStream.cpp
content/media/test/crashtests/874952.html
content/media/test/crashtests/crashtests.list
--- a/content/media/AudioNodeStream.cpp
+++ b/content/media/AudioNodeStream.cpp
@@ -389,23 +389,29 @@ AudioNodeStream::ProduceOutput(GraphTime
     // it's time to mark this stream as finished.
     FinishOutput();
   }
 
   StreamBuffer::Track* track = EnsureTrack();
 
   AudioSegment* segment = track->Get<AudioSegment>();
 
-  mLastChunks.SetLength(1);
-  mLastChunks[0].SetNull(0);
+  uint16_t outputCount = std::max(uint16_t(1), mEngine->OutputCount());
+  mLastChunks.SetLength(outputCount);
 
   if (mInCycle) {
     // XXX DelayNode not supported yet so just produce silence
-    mLastChunks[0].SetNull(WEBAUDIO_BLOCK_SIZE);
+    for (uint16_t i = 0; i < outputCount; ++i) {
+      mLastChunks[i].SetNull(WEBAUDIO_BLOCK_SIZE);
+    }
   } else {
+    for (uint16_t i = 0; i < outputCount; ++i) {
+      mLastChunks[i].SetNull(0);
+    }
+
     // We need to generate at least one input
     uint16_t maxInputs = std::max(uint16_t(1), mEngine->InputCount());
     OutputChunks inputChunks;
     inputChunks.SetLength(maxInputs);
     for (uint16_t i = 0; i < maxInputs; ++i) {
       ObtainInputBlock(inputChunks[i], i);
     }
     bool finished = false;
new file mode 100644
--- /dev/null
+++ b/content/media/test/crashtests/874952.html
@@ -0,0 +1,11 @@
+<script>
+var Context0= new AudioContext()
+var ChannelSplitter0=Context0.createChannelSplitter();
+var BiquadFilter0=Context0.createBiquadFilter();
+var WaveShaper0=Context0.createWaveShaper();
+
+ChannelSplitter0.connect(BiquadFilter0,3,0);
+ChannelSplitter0.connect(WaveShaper0);
+BiquadFilter0.disconnect();
+WaveShaper0.connect(ChannelSplitter0);
+</script>
--- a/content/media/test/crashtests/crashtests.list
+++ b/content/media/test/crashtests/crashtests.list
@@ -13,8 +13,9 @@ load 752784-1.html
 skip-if(Android||B2G) HTTP load 795892-1.html # load failed, bug 833371 for B2G
 skip-if(Android||B2G) load 789075-1.html # load failed, bug 833371 for B2G
 load 844563.html
 load 846612.html
 load 852838.html
 load 874869.html
 load 874915.html
 load 874934.html
+load 874952.html