Bug 1049302: Avoid audio delay in B2G audio-video getUserMedia captures r=roc
authorRandell Jesup <rjesup@jesup.org>
Wed, 06 Aug 2014 01:05:48 -0400
changeset 219799 e9348984ca0eabb416f501728223f0860a2ee7b1
parent 219798 d0c7741f70b6b4b78908b1357dc2aa2d1f3e1acf
child 219800 8d044c5d7c9247623585108b35a05cbc8a66fbf4
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)
reviewersroc
bugs1049302
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 1049302: Avoid audio delay in B2G audio-video getUserMedia captures r=roc
content/media/webrtc/MediaEngineWebRTCVideo.cpp
--- a/content/media/webrtc/MediaEngineWebRTCVideo.cpp
+++ b/content/media/webrtc/MediaEngineWebRTCVideo.cpp
@@ -134,18 +134,19 @@ MediaEngineWebRTCVideoSource::NotifyPull
                                          SourceMediaStream *aSource,
                                          TrackID aID,
                                          StreamTime aDesiredTime,
                                          TrackTicks &aLastEndTime)
 {
   VideoSegment segment;
 
   MonitorAutoLock lock(mMonitor);
-  if (mState != kStarted)
-    return;
+  // B2G does AddTrack, but holds kStarted until the hardware changes state.
+  // So mState could be kReleased here.  We really don't care about the state,
+  // though.
 
   // Note: we're not giving up mImage here
   nsRefPtr<layers::Image> image = mImage;
   TrackTicks target = aSource->TimeToTicksRoundUp(USECS_PER_S, aDesiredTime);
   TrackTicks delta = target - aLastEndTime;
   LOGFRAME(("NotifyPull, desired = %ld, target = %ld, delta = %ld %s", (int64_t) aDesiredTime,
             (int64_t) target, (int64_t) delta, image ? "" : "<null>"));