Bug 1440169 - Don't reset mLastNotify in resuming Start(). r?padenot
MozReview-Commit-ID: 6AL8QpSnwwm
--- 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;
};