Bug 784829. Initialize mIsConsumed at the start of every pass to determine what's consumed. r=jesup
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 29 Aug 2012 23:20:45 +1200
changeset 105793 3d7e89acf4c28738781595a4b586d0c92f31b171
parent 105792 a3660600273121e807fa1e0a0648d10fc791c7e8
child 105794 17b1db7b293fdfe59b4f2b558023129b5d804cf4
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersjesup
bugs784829
milestone18.0a1
Bug 784829. Initialize mIsConsumed at the start of every pass to determine what's consumed. r=jesup Also, might as well set mIsConsumed on every stream.
content/media/MediaStreamGraph.cpp
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -909,20 +909,17 @@ MediaStreamGraphImpl::UpdateStreamOrderF
   if (stream->mIsOnOrderingStack) {
     for (int32_t i = aStack->Length() - 1; ; --i) {
       aStack->ElementAt(i)->AsProcessedStream()->mInCycle = true;
       if (aStack->ElementAt(i) == stream)
         break;
     }
     return;
   }
-  SourceMediaStream* s = stream->AsSourceStream();
-  if (s) {
-    DetermineWhetherStreamIsConsumed(stream);
-  }
+  DetermineWhetherStreamIsConsumed(stream);
   ProcessedMediaStream* ps = stream->AsProcessedStream();
   if (ps) {
     aStack->AppendElement(stream);
     stream->mIsOnOrderingStack = true;
     for (uint32_t i = 0; i < ps->mInputs.Length(); ++i) {
       MediaStream* source = ps->mInputs[i]->mSource;
       if (!source->mHasBeenOrdered) {
         nsRefPtr<MediaStream> s = source;
@@ -941,16 +938,17 @@ void
 MediaStreamGraphImpl::UpdateStreamOrder()
 {
   nsTArray<nsRefPtr<MediaStream> > oldStreams;
   oldStreams.SwapElements(mStreams);
   for (uint32_t i = 0; i < oldStreams.Length(); ++i) {
     MediaStream* stream = oldStreams[i];
     stream->mHasBeenOrdered = false;
     stream->mKnowIsConsumed = false;
+    stream->mIsConsumed = false;
     stream->mIsOnOrderingStack = false;
     stream->mInBlockingSet = false;
     ProcessedMediaStream* ps = stream->AsProcessedStream();
     if (ps) {
       ps->mInCycle = false;
     }
   }