Bug 1060311 - Always use an AudioCallbackDriver when there is and AudioOutputStream. r=jesup
☠☠ backed out by 979e8914ba48 ☠ ☠
authorPaul Adenot <paul@paul.cx>
Fri, 29 Aug 2014 15:16:41 +0200
changeset 223996 aaa4cf41cade8e24576cb7224c33fd3699fecd52
parent 223995 32ea974e14922e1104aed8595636530325dfd557
child 223997 36cedce0c8b3e59e422368a49cc0fe8845e4e501
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1060311
milestone34.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 1060311 - Always use an AudioCallbackDriver when there is and AudioOutputStream. r=jesup This makes the driver switching logic more robust against other bugs.
content/media/MediaStreamGraph.cpp
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -893,24 +893,23 @@ MediaStreamGraphImpl::CreateOrDestroyAud
         audioOutputStreamsFound[i] = true;
       } else {
         MediaStream::AudioOutputStream* audioOutputStream =
           aStream->mAudioOutputStreams.AppendElement();
         audioOutputStream->mAudioPlaybackStartTime = aAudioOutputStartTime;
         audioOutputStream->mBlockedAudioTime = 0;
         audioOutputStream->mLastTickWritten = 0;
         audioOutputStream->mTrackID = tracks->GetID();
+      }
+    }
 
-        if (!CurrentDriver()->AsAudioCallbackDriver() &&
-            !CurrentDriver()->Switching()) {
-          AudioCallbackDriver* driver = new AudioCallbackDriver(this);
-          mMixer.AddCallback(driver);
-          CurrentDriver()->SwitchAtNextIteration(driver);
-        }
-      }
+    if (!CurrentDriver()->AsAudioCallbackDriver()) {
+      AudioCallbackDriver* driver = new AudioCallbackDriver(this);
+      mMixer.AddCallback(driver);
+      CurrentDriver()->SwitchAtNextIteration(driver);
     }
   }
 
   for (int32_t i = audioOutputStreamsFound.Length() - 1; i >= 0; --i) {
     if (!audioOutputStreamsFound[i]) {
       aStream->mAudioOutputStreams.RemoveElementAt(i);
     }
   }