b=914016 always dispatch main thread updates after non-realtime graph finishes r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 24 Oct 2013 07:21:33 +1300
changeset 166662 edbd846f2f18f9a29453f8ef5cbaf7b2064b1bbe
parent 166661 05073dcfd397fac7ed376284a68020aa010a8b5c
child 166663 936fe240cb00517ed0fc217d23461650a2507bc4
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs914016
milestone27.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
b=914016 always dispatch main thread updates after non-realtime graph finishes r=padenot
content/media/MediaStreamGraph.cpp
content/media/test/crashtests/crashtests.list
content/media/test/crashtests/offline-buffer-source-ended-1.html
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -955,19 +955,19 @@ MediaStreamGraphImpl::ShouldUpdateMainTh
   return false;
 }
 
 void
 MediaStreamGraphImpl::PrepareUpdatesToMainThreadState(bool aFinalUpdate)
 {
   mMonitor.AssertCurrentThreadOwns();
 
-  // We don't want to update the main thread about timing update when we are not
-  // running in realtime.
-  if (ShouldUpdateMainThread()) {
+  // We don't want to frequently update the main thread about timing update
+  // when we are not running in realtime.
+  if (aFinalUpdate || ShouldUpdateMainThread()) {
     mStreamUpdates.SetCapacity(mStreamUpdates.Length() + mStreams.Length());
     for (uint32_t i = 0; i < mStreams.Length(); ++i) {
       MediaStream* stream = mStreams[i];
       if (!stream->MainThreadNeedsUpdates()) {
         continue;
       }
       StreamUpdate* update = mStreamUpdates.AppendElement();
       update->mGraphUpdateIndex = stream->mGraphUpdateIndices.GetAt(mCurrentTime);
--- a/content/media/test/crashtests/crashtests.list
+++ b/content/media/test/crashtests/crashtests.list
@@ -54,11 +54,12 @@ test-pref(media.webvtt.enabled,true) loa
 load 907986-1.html
 load 907986-2.html
 load 907986-3.html
 load 907986-4.html
 load 910171-1.html
 load 920987.html
 load 925619-1.html
 load 925619-2.html
+load offline-buffer-source-ended-1.html
 skip-if(B2G) load oscillator-ended-1.html # intermittent B2G timeouts, bug 920338
 skip-if(B2G) load oscillator-ended-2.html # intermittent B2G timeouts, bug 920338
 test-pref(media.mediasource.enabled,true) load 926665.html
new file mode 100644
--- /dev/null
+++ b/content/media/test/crashtests/offline-buffer-source-ended-1.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<script>
+// Currently this test fails unless an extra block is processed after the
+// BufferSource finishes. 12033 ≡ 1 (mod 128), but the test should pass even
+// when only 12001 samples are processed.
+var context = new window.OfflineAudioContext(1, 12033, 12000);
+
+var source = context.createBufferSource();
+source.buffer = context.createBuffer(1, 12000, context.sampleRate);
+source.onended = function(e) {
+  document.documentElement.removeAttribute("class");
+}
+source.connect(context.destination);
+source.start(0);
+
+context.startRendering();
+</script>