Bug 1090983 - Invoke UpdateReadyState() after invoking SetState(). r=cpearce
authorBobby Holley <bobbyholley@gmail.com>
Thu, 30 Oct 2014 09:16:02 +0100
changeset 213070 272af6fe4c647c31f199a83207ff13701b03aff8
parent 213069 76d469458524188311300a9091314438b128761d
child 213071 32a7f74c5c10f0c53ca47b4a73fe4d61fbcafd04
push id27738
push usercbook@mozilla.com
push dateThu, 30 Oct 2014 13:46:07 +0000
treeherdermozilla-central@1aa1b23d799e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1090983
milestone36.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 1090983 - Invoke UpdateReadyState() after invoking SetState(). r=cpearce Otherwise, UpdateReadyState() will think that nothing has changed.
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2970,18 +2970,18 @@ void MediaDecoderStateMachine::StartBuff
   // We can't just directly send an asynchronous runnable that
   // eventually fires the "waiting" event. The problem is that
   // there might be pending main-thread events, such as "data
   // received" notifications, that mean we're not actually still
   // buffering by the time this runnable executes. So instead
   // we just trigger UpdateReadyStateForData; when it runs, it
   // will check the current state and decide whether to tell
   // the element we're buffering or not.
+  SetState(DECODER_STATE_BUFFERING);
   UpdateReadyState();
-  SetState(DECODER_STATE_BUFFERING);
   DECODER_LOG("Changed state from DECODING to BUFFERING, decoded for %.3lfs",
               decodeDuration.ToSeconds());
 #ifdef PR_LOGGING
   MediaDecoder::Statistics stats = mDecoder->GetStatistics();
   DECODER_LOG("Playback rate: %.1lfKB/s%s download rate: %.1lfKB/s%s",
               stats.mPlaybackRate/1024, stats.mPlaybackRateReliable ? "" : " (unreliable)",
               stats.mDownloadRate/1024, stats.mDownloadRateReliable ? "" : " (unreliable)");
 #endif