Bug 1317576. Part 5 - run Step() in CompletedState::Enter() without scheduling an additional cycle. draft
authorJW Wang <jwwang@mozilla.com>
Tue, 15 Nov 2016 11:54:52 +0800
changeset 439472 08bdb03b70964c912a002f11fd413eaf85cd4af6
parent 439471 8cbf64a955d6d47dc8ae0436738ed9258eafa530
child 439473 6f9f800e338bc09179f1b7818d93395fff92993a
push id36009
push userjwwang@mozilla.com
push dateWed, 16 Nov 2016 02:24:06 +0000
bugs1317576
milestone53.0a1
Bug 1317576. Part 5 - run Step() in CompletedState::Enter() without scheduling an additional cycle. MDSM might have reached the end of playback. We want to notify 'playbackEnded' ASAP. MozReview-Commit-ID: FYI6xTWuNSD
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1015,17 +1015,17 @@ class MediaDecoderStateMachine::Complete
 public:
   explicit CompletedState(Master* aPtr) : StateObject(aPtr) {}
 
   void Enter()
   {
     // We've decoded all samples. We don't need decoders anymore.
     Reader()->ReleaseResources();
 
-    mMaster->ScheduleStateMachine();
+    Step();
   }
 
   void Exit() override
   {
     mSentPlaybackEndedEvent = false;
   }
 
   void Step() override