Bug 1216417 - Make sure audio output streams are created after adding an audio output. r=baku, r=roc, a=ritu, a=sylvestre
authorAndreas Pehrson <pehrsons@gmail.com>
Thu, 29 Oct 2015 13:18:38 +0800
changeset 307696 37d6cc3600233fc234688927f5e2615c74c41496
parent 307695 a54630b3ac766e8b1e1677bc8da90b2ce241bae4
child 307697 09bdeec1b65cd16c0390d48bfcdc922a924eb568
push id7348
push userjbruaroey@mozilla.com
push dateMon, 09 Nov 2015 21:46:36 +0000
reviewersbaku, roc, ritu, sylvestre
bugs1216417
milestone43.0
Bug 1216417 - Make sure audio output streams are created after adding an audio output. r=baku, r=roc, a=ritu, a=sylvestre
dom/media/MediaStreamGraph.cpp
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -575,17 +575,18 @@ MediaStreamGraphImpl::CreateOrDestroyAud
 {
   MOZ_ASSERT(mRealtime, "Should only attempt to create audio streams in real-time mode");
 
   if (aStream->mAudioOutputs.IsEmpty()) {
     aStream->mAudioOutputStreams.Clear();
     return;
   }
 
-  if (!aStream->GetStreamBuffer().GetAndResetTracksDirty()) {
+  if (!aStream->GetStreamBuffer().GetAndResetTracksDirty() &&
+      !aStream->mAudioOutputStreams.IsEmpty()) {
     return;
   }
 
   nsAutoTArray<bool,2> audioOutputStreamsFound;
   for (uint32_t i = 0; i < aStream->mAudioOutputStreams.Length(); ++i) {
     audioOutputStreamsFound.AppendElement(false);
   }