Bug 997229 - Don't call IdealAudioRate on an offline MediaStreamGraph r=roc
authorPaul Adenot <paul@paul.cx>
Thu, 17 Apr 2014 11:15:47 +0200
changeset 179372 d53bccef7150e32f407ff1e84b26a35f69f01aa4
parent 179371 735fb8486e8e29648e1ad3cf4840c2d534414461
child 179373 54ac1366823a96f3a8aaed009f1ca570e7c4464b
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersroc
bugs997229
milestone31.0a1
Bug 997229 - Don't call IdealAudioRate on an offline MediaStreamGraph r=roc
content/media/MediaStreamGraph.cpp
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -1254,27 +1254,29 @@ MediaStreamGraphImpl::RunThread()
       }
     }
     messageQueue.Clear();
 
     if (mStreamOrderDirty) {
       UpdateStreamOrder();
     }
 
+    TrackRate sampleRate;
     // Find the sampling rate that we need to use for non-realtime graphs.
-    TrackRate sampleRate = IdealAudioRate();
     if (!mRealtime) {
       for (uint32_t i = 0; i < mStreams.Length(); ++i) {
         AudioNodeStream* n = mStreams[i]->AsAudioNodeStream();
         if (n) {
           // We know that the rest of the streams will run at the same rate.
           sampleRate = n->SampleRate();
           break;
         }
       }
+    } else {
+      sampleRate = IdealAudioRate();
     }
 
     GraphTime endBlockingDecisions =
       RoundUpToNextAudioBlock(sampleRate, mCurrentTime + MillisecondsToMediaTime(AUDIO_TARGET_MS));
     bool ensureNextIteration = false;
 
     // Grab pending stream input.
     for (uint32_t i = 0; i < mStreams.Length(); ++i) {