b=926619 check for non-AudioNodeStreams in MediaStream cycles r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 25 Oct 2013 14:05:41 +1300
changeset 165859 54c627598be1ab3a4ee93ed5411f6e405d71c54a
parent 165858 72efd8463aa03ebd3e28cab75b7499613a73de61
child 165860 f266795178da20022786b0c10ffd966056e745d9
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs926619
milestone27.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
b=926619 check for non-AudioNodeStreams in MediaStream cycles r=padenot
content/media/MediaStreamGraph.cpp
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -494,26 +494,28 @@ MediaStreamGraphImpl::UpdateStreamOrderF
       } while (iter && iter != stream);
     }
     if (cycleFound && !delayNodePresent) {
       // If we have detected a cycle, the previous loop should exit with stream
       // == iter, or the node is connected to itself. Go back in the cycle and
       // mute all nodes we find, or just mute the node itself.
       if (!iter) {
         // The node is connected to itself.
+        // There can't be a non-AudioNodeStream here, because only AudioNodes
+        // can be self-connected.
         iter = aStack->getLast();
+        MOZ_ASSERT(iter->AsAudioNodeStream());
         iter->AsAudioNodeStream()->Mute();
       } else {
         MOZ_ASSERT(iter);
         do {
-          // There can't be non-AudioNodeStream here, MediaStreamAudio{Source,
-          // Destination}Node are connected to regular MediaStreams, but they can't be
-          // in a cycle (there is no content API to do so).
-          MOZ_ASSERT(iter->AsAudioNodeStream());
-          iter->AsAudioNodeStream()->Mute();
+          AudioNodeStream* nodeStream = iter->AsAudioNodeStream();
+          if (nodeStream) {
+            nodeStream->Mute();
+          }
         } while((iter = iter->getNext()));
       }
     }
     return;
   }
   ProcessedMediaStream* ps = stream->AsProcessedStream();
   if (ps) {
     aStack->insertBack(stream);