Bug 1397793 - Remove mRate from MediaEngineDefault and use GraphRate(). r=pehrsons
authorPaul Adenot <paul@paul.cx>
Wed, 08 Nov 2017 15:16:06 +0100
changeset 448071 ea71d48c6b640cc731dd4f7e3f136c00ebe67854
parent 448070 ae73bf20687158121fd2459eaa5f1182dab3bb9d
child 448072 43b35e28df74c3b5a4236042b51b5abd47860cde
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1397793
milestone59.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 1397793 - Remove mRate from MediaEngineDefault and use GraphRate(). r=pehrsons MozReview-Commit-ID: D9x3wICAMNA
dom/media/webrtc/MediaEngineDefault.cpp
dom/media/webrtc/MediaEngineDefault.h
--- a/dom/media/webrtc/MediaEngineDefault.cpp
+++ b/dom/media/webrtc/MediaEngineDefault.cpp
@@ -412,17 +412,17 @@ MediaEngineDefaultAudioSource::Start(Sou
 
   if (!mSineGenerator) {
     // generate sine wave (default 1KHz)
     mSineGenerator = new SineWaveGenerator(aStream->GraphRate(), mFreq);
   }
 
   // AddTrack will take ownership of segment
   AudioSegment* segment = new AudioSegment();
-  aStream->AddAudioTrack(aID, mRate, 0, segment, SourceMediaStream::ADDTRACK_QUEUED);
+  aStream->AddAudioTrack(aID, aStream->GraphRate(), 0, segment, SourceMediaStream::ADDTRACK_QUEUED);
 
   // Remember TrackID so we can finish later
   mTrackID = aID;
 
   mLastNotify = 0;
   mState = kStarted;
   return NS_OK;
 }
@@ -468,17 +468,17 @@ MediaEngineDefaultAudioSource::NotifyPul
                                           SourceMediaStream *aSource,
                                           TrackID aID,
                                           StreamTime aDesiredTime,
                                           const PrincipalHandle& aPrincipalHandle)
 {
   MOZ_ASSERT(aID == mTrackID);
   AudioSegment segment;
   // avoid accumulating rounding errors
-  TrackTicks desired = aSource->TimeToTicksRoundUp(mRate, aDesiredTime);
+  TrackTicks desired = aSource->TimeToTicksRoundUp(aGraph->GraphRate(), aDesiredTime);
   TrackTicks delta = desired - mLastNotify;
   mLastNotify += delta;
   AppendToSegment(segment, delta, aPrincipalHandle);
   aSource->AppendToTrack(mTrackID, &segment);
 }
 
 void
 MediaEngineDefault::EnumerateVideoDevices(dom::MediaSourceEnum aMediaSource,
--- a/dom/media/webrtc/MediaEngineDefault.h
+++ b/dom/media/webrtc/MediaEngineDefault.h
@@ -183,17 +183,16 @@ public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
 protected:
   ~MediaEngineDefaultAudioSource();
 
   TrackID mTrackID;
 
   TrackTicks mLastNotify; // Accessed in ::Start(), then on NotifyPull (from MSG thread)
-  TrackRate mRate; // ditto
   uint32_t mFreq; // ditto
 
   // Created on Start, then accessed from NotifyPull (MSG thread)
   nsAutoPtr<SineWaveGenerator> mSineGenerator;
 };
 
 
 class MediaEngineDefault : public MediaEngine