Bug 1371202. P2 - don't release decoders if we are looping since we will need them soon. r=jya
authorJW Wang <jwwang@mozilla.com>
Thu, 08 Jun 2017 11:42:43 +0800
changeset 411553 52b2148d954c3c012901e42529035e27edc88cc6
parent 411552 9305945e748c7196d5927ba08da9185d1a52b597
child 411554 daa0394d99737310d2595b63db235ba0d4498ca9
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1371202
milestone55.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 1371202. P2 - don't release decoders if we are looping since we will need them soon. r=jya MozReview-Commit-ID: L1hOBytfENK
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1905,18 +1905,21 @@ class MediaDecoderStateMachine::Complete
 public:
   explicit CompletedState(Master* aPtr) : StateObject(aPtr) { }
 
   void Enter()
   {
     // TODO : use more approriate way to decide whether need to release
     // resource in bug1367983.
 #ifndef MOZ_WIDGET_ANDROID
-    // We've decoded all samples. We don't need decoders anymore.
-    Reader()->ReleaseResources();
+    if (!mMaster->mLooping) {
+      // We've decoded all samples.
+      // We don't need decoders anymore if not looping.
+      Reader()->ReleaseResources();
+    }
 #endif
     bool hasNextFrame = (!mMaster->HasAudio() || !mMaster->mAudioCompleted)
                         && (!mMaster->HasVideo() || !mMaster->mVideoCompleted);
 
     mMaster->UpdateNextFrameStatus(
       hasNextFrame ? MediaDecoderOwner::NEXT_FRAME_AVAILABLE
                    : MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE);