Bug 1065827 - Start MediaDecoder playback state in LOADING. r=cpearce
☠☠ backed out by 6791ee4cd303 ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 28 Oct 2014 20:10:08 +1100
changeset 230590 aebe859551b3c0a327060b43c22ba1461172b141
parent 230589 7822514901e6008021b06bad4d862fa7c62b7bcf
child 230591 44f27b3c35d47fe906b0ecf42c55de5d4cf0d56e
push id7326
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:58:42 +0000
treeherdermozilla-aurora@d3a3b2a0f2f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1065827
milestone36.0a1
Bug 1065827 - Start MediaDecoder playback state in LOADING. r=cpearce
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -432,17 +432,17 @@ MediaDecoder::MediaDecoder() :
   mInitialPlaybackRate(1.0),
   mInitialPreservesPitch(true),
   mDuration(-1),
   mMediaSeekable(true),
   mSameOriginMedia(false),
   mReentrantMonitor("media.decoder"),
   mIsDormant(false),
   mIsExitingDormant(false),
-  mPlayState(PLAY_STATE_PAUSED),
+  mPlayState(PLAY_STATE_LOADING),
   mNextState(PLAY_STATE_PAUSED),
   mIgnoreProgressData(false),
   mInfiniteStream(false),
   mOwner(nullptr),
   mPlaybackStatistics(new MediaChannelStatistics()),
   mPinnedForSeek(false),
   mShuttingDown(false),
   mPausedForPlaybackRateNull(false),
@@ -557,18 +557,16 @@ nsresult MediaDecoder::InitializeStateMa
   nsresult rv = mDecoderStateMachine->Init(
       cloneDonor ? cloneDonor->mDecoderStateMachine : nullptr);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // If some parameters got set before the state machine got created,
   // set them now
   SetStateMachineParameters();
 
-  ChangeState(PLAY_STATE_LOADING);
-
   return ScheduleStateMachineThread();
 }
 
 void MediaDecoder::SetStateMachineParameters()
 {
   ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
   mDecoderStateMachine->SetDuration(mDuration);
   mDecoderStateMachine->SetVolume(mInitialVolume);