Bug 1216417 - Make sure audio output streams are created after adding an audio output. r=baku, r=roc, a=ritu
authorAndreas Pehrson <pehrsons@gmail.com>
Thu, 29 Oct 2015 13:18:38 +0800
changeset 284471 7daa3893eab7
parent 284470 1cfd7b285723
child 284472 ae4965be0983
push id120
push usercbook@mozilla.com
push dateFri, 06 Nov 2015 13:18:50 +0000
reviewersbaku, roc, ritu
bugs1216417
milestone44.0a2
Bug 1216417 - Make sure audio output streams are created after adding an audio output. r=baku, r=roc, a=ritu
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);
   }