Bug 1347892 part 3 - dont change video decode mode if a media element is in-tree with UNTRACKED visibility state; r=jwwang
authorKaku Kuo <kaku@mozilla.com>
Fri, 17 Mar 2017 13:06:12 +0800
changeset 348393 f8ed75883a870534fbc0e4ad25d69620fdcdad07
parent 348392 f9a5c34a94166b47c62096795e138bc6f1c5e678
child 348394 b30acdd58bdd71cf6cd4854f11ed84a651d948ef
push id39141
push userihsiao@mozilla.com
push dateMon, 20 Mar 2017 03:46:12 +0000
treeherderautoland@f8ed75883a87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1347892
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 1347892 part 3 - dont change video decode mode if a media element is in-tree with UNTRACKED visibility state; r=jwwang If a media element is in-tree with UNTRACKED visibility state, the information is incomplete, just ignore it. MozReview-Commit-ID: FcKybQZqF6c
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1310,16 +1310,22 @@ MediaDecoder::SetSuspendTaint(bool aTain
 void
 MediaDecoder::UpdateVideoDecodeMode()
 {
   // The MDSM may yet be set.
   if (!mDecoderStateMachine) {
     return;
   }
 
+  // If an element is in-tree with UNTRACKED visibility, the visibility is
+  // incomplete and don't update the video decode mode.
+  if (mIsElementInTree && mElementVisibility == Visibility::UNTRACKED) {
+    return;
+  }
+
   // If mHasSuspendTaint is set, never suspend the video decoder.
   if (mHasSuspendTaint) {
     mDecoderStateMachine->SetVideoDecodeMode(VideoDecodeMode::Normal);
     return;
   }
 
   // Don't suspend elements that is not in tree.
   if (!mIsElementInTree) {