Bug 1423241 - Unify decoder and stream paths in HTMLMediaElement::AddRemoveSelfReference. r=jya
authorAndreas Pehrson <apehrson@mozilla.com>
Fri, 23 Nov 2018 15:03:21 +0000
changeset 507066 3db9a18c3061815fd97a84d5389bae91cc8ef31a
parent 507065 0e6607a8aaf61a549f669821dd74f084f9ff6854
child 507067 7ef7361d484970cec603e784b4f37c274cc7fda0
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1423241
milestone65.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 1423241 - Unify decoder and stream paths in HTMLMediaElement::AddRemoveSelfReference. r=jya Differential Revision: https://phabricator.services.mozilla.com/D12287
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -6583,19 +6583,20 @@ HTMLMediaElement::AddRemoveSelfReference
   // element alive if it was playing and producing audio output --- right now
   // that's covered by the !mPaused check.
   nsIDocument* ownerDoc = OwnerDoc();
 
   // See the comment at the top of this file for the explanation of this
   // boolean expression.
   bool needSelfReference =
     !mShuttingDown && ownerDoc->IsActive() &&
-    (mDelayingLoadEvent || (!mPaused && mDecoder && !mDecoder->IsEnded()) ||
-     (!mPaused && mSrcStream && !mSrcStream->IsFinished()) ||
-     (mDecoder && mDecoder->IsSeeking()) || CanActivateAutoplay() ||
+    (mDelayingLoadEvent ||
+     (!mPaused && !Ended()) ||
+     (mDecoder && mDecoder->IsSeeking()) ||
+     CanActivateAutoplay() ||
      (mMediaSource ? mProgressTimer : mNetworkState == NETWORK_LOADING));
 
   if (needSelfReference != mHasSelfReference) {
     mHasSelfReference = needSelfReference;
     RefPtr<HTMLMediaElement> self = this;
     if (needSelfReference) {
       // The shutdown observer will hold a strong reference to us. This
       // will do to keep us alive. We need to know about shutdown so that