Bug 1309516 part 8 - modify MDSM::RecomputeDuration();r=jwwang
☠☠ backed out by fb72036436f9 ☠ ☠
authorKaku Kuo <kaku@mozilla.com>
Mon, 24 Oct 2016 15:04:52 +0800
changeset 320051 5cb98008b3e36900ae4e786052d945c1001cb488
parent 320050 9ddc65900391f0bdf1c42cde846cce304dd44fef
child 320052 9c2c3780aa4c599699b7bc87ef15566cadc8ccf0
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1309516
milestone52.0a1
Bug 1309516 part 8 - modify MDSM::RecomputeDuration();r=jwwang MozReview-Commit-ID: 6pM7Kn3kZco
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2406,17 +2406,20 @@ void MediaDecoderStateMachine::Recompute
       // any other duration sources), but the duration isn't ready yet.
       return;
     }
     // We don't fire duration changed for this case because it should have
     // already been fired on the main thread when the explicit duration was set.
     duration = TimeUnit::FromSeconds(d);
   } else if (mEstimatedDuration.Ref().isSome()) {
     duration = mEstimatedDuration.Ref().ref();
-  } else if (Info().mMetadataDuration.isSome()) {
+  } else if (mInfo.isSome() && Info().mMetadataDuration.isSome()) {
+    // We need to check mInfo.isSome() because that this method might be invoked
+    // while mObservedDuration is changed which might before the metadata been
+    // read.
     duration = Info().mMetadataDuration.ref();
   } else {
     return;
   }
 
   // Only adjust the duration when an explicit duration isn't set (MSE).
   // The duration is always exactly known with MSE and there's no need to adjust
   // it based on what may have been seen in the past; in particular as this data