Bug 1299074. Part 3 - check |mSentFirstFrameLoadedEvent| to know whether we can finish decoding first frames. r=kaku
authorJW Wang <jwwang@mozilla.com>
Tue, 30 Aug 2016 16:32:36 +0800
changeset 312181 13ca0eb5671e034c0c689262218a6fa98d54867a
parent 312180 0e2ee827b4be3a090ee0bc3aae2d1e335e37506a
child 312182 c454a29b2ede95b157bf802d28be8ea61401261d
push id31913
push userjwwang@mozilla.com
push dateThu, 01 Sep 2016 03:39:16 +0000
treeherderautoland@0dfbee74cdbb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1299074
milestone51.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 1299074. Part 3 - check |mSentFirstFrameLoadedEvent| to know whether we can finish decoding first frames. r=kaku MozReview-Commit-ID: 10VNH3rhPpy
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2160,19 +2160,21 @@ MediaDecoderStateMachine::SeekCompleted(
   // Reset the MediaDecoderReaderWrapper's callbask.
   DiscardSeekTaskIfExist();
 
   // NOTE: Discarding the mSeekTask must be done before here. The following code
   // might ask the MediaDecoderReaderWrapper to request media data, however, the
   // SeekTask::Discard() will ask MediaDecoderReaderWrapper to discard media
   // data requests.
 
-  if (mDecodingFirstFrame) {
-    // We were resuming from dormant, or initiated a seek early.
-    // We can fire loadeddata now.
+  // Notify FirstFrameLoaded now if we haven't since we've decoded some data
+  // for readyState to transition to HAVE_CURRENT_DATA and fire 'loadeddata'.
+  if (!mSentFirstFrameLoadedEvent) {
+    // Only MSE can start seeking before finishing decoding first frames.
+    MOZ_ASSERT(mReader->ForceZeroStartTime());
     FinishDecodeFirstFrame();
   }
 
   // Ensure timestamps are up to date.
   UpdatePlaybackPositionInternal(newCurrentTime);
 
   // Try to decode another frame to detect if we're at the end...
   DECODER_LOG("Seek completed, mCurrentPosition=%lld", mCurrentPosition.Ref());