Bug 1121658 - Remove DestroyDecodedStream() from MediaDecoder::SetDormantIfNecessary() r=roc a=sledru
authorSotaro Ikeda <sikeda@mozilla.com>
Fri, 16 Jan 2015 06:56:14 -0800
changeset 242982 731843c58e0d
parent 242981 d918f7ea93fe
child 242983 09df37258699
push id4354
push userrgiles@mozilla.com
push date2015-01-22 18:52 +0000
treeherdermozilla-beta@a48f8c55a98c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, sledru
bugs1121658
milestone36.0
Bug 1121658 - Remove DestroyDecodedStream() from MediaDecoder::SetDormantIfNecessary() r=roc a=sledru
dom/media/MediaDecoder.cpp
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -126,17 +126,16 @@ void MediaDecoder::SetDormantIfNecessary
   if (!mDecoderStateMachine ||
       !mDecoderStateMachine->IsDormantNeeded() ||
       mPlayState == PLAY_STATE_SHUTDOWN) {
     return;
   }
 
   if(aDormant) {
     // enter dormant state
-    DestroyDecodedStream();
     mDecoderStateMachine->SetDormant(true);
 
     int64_t timeUsecs = 0;
     SecondsToUsecs(mCurrentTime, timeUsecs);
     mRequestedSeekTarget = SeekTarget(timeUsecs, SeekTarget::Accurate);
 
     mNextState = mPlayState;
     ChangeState(PLAY_STATE_LOADING);
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1477,16 +1477,17 @@ void MediaDecoderStateMachine::SetDorman
       } else if (mCurrentSeekTarget.IsValid()) {
         mQueuedSeekTarget = mCurrentSeekTarget;
       }
     }
     mSeekTarget.Reset();
     mCurrentSeekTarget.Reset();
     ScheduleStateMachine();
     SetState(DECODER_STATE_DORMANT);
+    StopPlayback();
     mDecoder->GetReentrantMonitor().NotifyAll();
   } else if ((aDormant != true) && (mState == DECODER_STATE_DORMANT)) {
     mDecodingFrozenAtStateDecoding = true;
     ScheduleStateMachine();
     mCurrentFrameTime = 0;
     SetState(DECODER_STATE_DECODING_NONE);
     mDecoder->GetReentrantMonitor().NotifyAll();
   }