Bug 1440169 - Don't reset mLastNotify in resuming Start(). r=padenot
authorAndreas Pehrson <pehrsons@mozilla.com>
Fri, 02 Mar 2018 12:48:34 +0100
changeset 406271 91d6515d47cd20dd10f8c305324fdf33d2a213e9
parent 406270 df7b724956eb943a25b30f3f75204f8d8255c1d2
child 406272 9552b5f236a56a89edbe0625231502b3d8fe5bcd
child 406281 10c6cc561b13c704ee9c7d14b3b48fbea5ca7b07
push id33550
push userapavel@mozilla.com
push dateFri, 02 Mar 2018 16:19:44 +0000
treeherdermozilla-central@9552b5f236a5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1440169
milestone60.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 1440169 - Don't reset mLastNotify in resuming Start(). r=padenot MozReview-Commit-ID: 6AL8QpSnwwm
dom/media/webrtc/MediaEngineDefault.cpp
dom/media/webrtc/MediaEngineDefault.h
--- a/dom/media/webrtc/MediaEngineDefault.cpp
+++ b/dom/media/webrtc/MediaEngineDefault.cpp
@@ -87,17 +87,16 @@ MediaEngineDefaultVideoSource::Allocate(
   FlattenedConstraints c(aConstraints);
 
   // Mock failure for automated tests.
   if (c.mDeviceId.mIdeal.find(NS_LITERAL_STRING("bad device")) !=
       c.mDeviceId.mIdeal.end()) {
     return NS_ERROR_FAILURE;
   }
 
-
   // emulator debug is very, very slow; reduce load on it with smaller/slower fake video
   mOpts = aPrefs;
   mOpts.mWidth = c.mWidth.Get(aPrefs.mWidth ? aPrefs.mWidth :
 #ifdef DEBUG
                               MediaEnginePrefs::DEFAULT_43_VIDEO_WIDTH/2
 #else
                               MediaEnginePrefs::DEFAULT_43_VIDEO_WIDTH
 #endif
@@ -481,18 +480,16 @@ MediaEngineDefaultAudioSource::Start(con
   MOZ_ASSERT(mStream, "SetTrack() must happen before Start()");
   MOZ_ASSERT(IsTrackIDExplicit(mTrackID), "SetTrack() must happen before Start()");
 
   if (!mSineGenerator) {
     // generate sine wave (default 1KHz)
     mSineGenerator = new SineWaveGenerator(mStream->GraphRate(), mFreq);
   }
 
-  mLastNotify = 0;
-
   MutexAutoLock lock(mMutex);
   mState = kStarted;
   return NS_OK;
 }
 
 nsresult
 MediaEngineDefaultAudioSource::Stop(const RefPtr<const AllocationHandle>& aHandle)
 {
--- a/dom/media/webrtc/MediaEngineDefault.h
+++ b/dom/media/webrtc/MediaEngineDefault.h
@@ -168,17 +168,17 @@ protected:
   Mutex mMutex;
 
   // Current state of this source.
   // Set under mMutex on the owning thread. Accessed under one of the two.
   MediaEngineSourceState mState = kReleased;
   RefPtr<SourceMediaStream> mStream;
   TrackID mTrackID = TRACK_NONE;
 
-  // Accessed in ::Start(), then on Pull (from MSG thread)
+  // Accessed in Pull (from MSG thread)
   TrackTicks mLastNotify = 0;
   uint32_t mFreq = 1000; // ditto
 
   // Created on Start, then accessed from Pull (MSG thread)
   nsAutoPtr<SineWaveGenerator> mSineGenerator;
 };