Bug 1311594 - Release decoders when MDSM has decoded all audio/video frames. r=cpearce
authorJW Wang <jwwang@mozilla.com>
Tue, 11 Oct 2016 17:30:25 +0800
changeset 319270 2be061c5d070c962862c62bed8171b5d41654533
parent 319196 9fb2ac0875ec35268701dd3826b017a301cc7400
child 319271 b7fb1a72dd5cfe9342a6f5284da74502de1bea36
push id30869
push userphilringnalda@gmail.com
push dateWed, 26 Oct 2016 04:57:48 +0000
treeherdermozilla-central@9471b3c49b2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1311594
milestone52.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 1311594 - Release decoders when MDSM has decoded all audio/video frames. r=cpearce MozReview-Commit-ID: LoFgTYebYaj
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -983,16 +983,19 @@ private:
 class MediaDecoderStateMachine::CompletedState
   : public MediaDecoderStateMachine::StateObject
 {
 public:
   explicit CompletedState(Master* aPtr) : StateObject(aPtr) {}
 
   void Enter()
   {
+    // We've decoded all samples. We don't need decoders anymore.
+    Reader()->ReleaseResources();
+
     mMaster->ScheduleStateMachine();
   }
 
   void Exit() override
   {
     mSentPlaybackEndedEvent = false;
   }