Backed out 7 changesets (bug 1128069) for wpt failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 25 Aug 2016 08:50:35 -0400
changeset 340456 e441403ef6a8ac09f9316184c9e86e76a4ff8a06
parent 340455 a84b57a1e9f8ce75b8435cb40bf6f7a1576a422d
child 340457 a37eba7b5746020ab905019788fe46c7c8548e23
push id6339
push userryanvm@gmail.com
push dateThu, 25 Aug 2016 12:50:40 +0000
treeherdermozilla-beta@e441403ef6a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1128069
milestone49.0
backs outdcdb0d847056e6c461801e6c5cbd833139462f3a
3ab8087d6442cb205e1eafae625a842062a8ae73
59249959e5918499c190bea0f9984bd32a617caa
b6a0e932239c9fae2ac8913a18487b2e410d0661
54443c52eafe3847f0d3cf5539489a43dafd4152
4cc53d8de37e440f782b856d5f91328c9424ba3c
cfb0fd8665b89157d54f7ad802a0382a2736242c
Backed out 7 changesets (bug 1128069) for wpt failures. Backed out changeset dcdb0d847056 (bug 1128069) Backed out changeset 3ab8087d6442 (bug 1128069) Backed out changeset 59249959e591 (bug 1128069) Backed out changeset b6a0e932239c (bug 1128069) Backed out changeset 54443c52eafe (bug 1128069) Backed out changeset 4cc53d8de37e (bug 1128069) Backed out changeset cfb0fd8665b8 (bug 1128069)
dom/media/MediaDecoder.cpp
dom/media/MediaDecoderStateMachine.cpp
dom/media/mediasource/MediaSourceDecoder.cpp
dom/media/mediasource/MediaSourceDecoder.h
dom/media/mediasource/SourceBuffer.cpp
testing/web-platform/meta/media-source/mediasource-play-then-seek-back.html.ini
testing/web-platform/meta/media-source/mediasource-seek-beyond-duration.html.ini
testing/web-platform/tests/media-source/mediasource-play-then-seek-back.html
testing/web-platform/tests/media-source/mediasource-seek-beyond-duration.html
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1326,19 +1326,16 @@ void
 MediaDecoder::UpdateLogicalPositionInternal(MediaDecoderEventVisibility aEventVisibility)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (mShuttingDown) {
     return;
   }
 
   double currentPosition = static_cast<double>(CurrentPosition()) / static_cast<double>(USECS_PER_S);
-  if (mPlayState == PLAY_STATE_ENDED) {
-    currentPosition = std::max(currentPosition, mDuration);
-  }
   bool logicalPositionChanged = mLogicalPosition != currentPosition;
   mLogicalPosition = currentPosition;
 
   // Invalidate the frame so any video data is displayed.
   // Do this before the timeupdate event so that if that
   // event runs JavaScript that queries the media size, the
   // frame has reflowed and the size updated beforehand.
   Invalidate();
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1118,22 +1118,17 @@ void MediaDecoderStateMachine::Recompute
   } else if (mEstimatedDuration.Ref().isSome()) {
     duration = mEstimatedDuration.Ref().ref();
   } else if (mInfo.mMetadataDuration.isSome()) {
     duration = mInfo.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
-  // may no longer exist such as when the mediasource duration was reduced.
-  if (mExplicitDuration.Ref().isNothing() &&
-      duration < mObservedDuration.Ref()) {
+  if (duration < mObservedDuration.Ref()) {
     duration = mObservedDuration;
   }
 
   MOZ_ASSERT(duration.ToMicroseconds() >= 0);
   mDuration = Some(duration);
 }
 
 void
--- a/dom/media/mediasource/MediaSourceDecoder.cpp
+++ b/dom/media/mediasource/MediaSourceDecoder.cpp
@@ -176,22 +176,17 @@ MediaSourceDecoder::DetachMediaSource()
   mMediaSource = nullptr;
 }
 
 void
 MediaSourceDecoder::Ended(bool aEnded)
 {
   MOZ_ASSERT(NS_IsMainThread());
   static_cast<MediaSourceResource*>(GetResource())->SetEnded(aEnded);
-  if (aEnded) {
-    // We want the MediaSourceReader to refresh its buffered range as it may
-    // have been modified (end lined up).
-    NotifyDataArrived();
-  }
-  mEnded = aEnded;
+  mEnded = true;
 }
 
 void
 MediaSourceDecoder::AddSizeOfResources(ResourceSizes* aSizes)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (GetDemuxer()) {
     GetDemuxer()->AddSizeOfResources(aSizes);
@@ -310,18 +305,16 @@ MediaSourceDecoder::CanPlayThrough()
                         timeAhead,
                         MediaSourceDemuxer::EOS_FUZZ);
   return GetBuffered().Contains(ClampIntervalToEnd(interval));
 }
 
 TimeInterval
 MediaSourceDecoder::ClampIntervalToEnd(const TimeInterval& aInterval)
 {
-  MOZ_ASSERT(NS_IsMainThread());
-
   if (!mEnded) {
     return aInterval;
   }
   TimeInterval interval(TimeUnit(), TimeUnit::FromSeconds(GetDuration()));
   return aInterval.Intersection(interval);
 }
 
 #undef MSE_DEBUG
--- a/dom/media/mediasource/MediaSourceDecoder.h
+++ b/dom/media/mediasource/MediaSourceDecoder.h
@@ -87,14 +87,14 @@ private:
 
   // The owning MediaSource holds a strong reference to this decoder, and
   // calls Attach/DetachMediaSource on this decoder to set and clear
   // mMediaSource.
   dom::MediaSource* mMediaSource;
   RefPtr<MediaSourceDemuxer> mDemuxer;
   RefPtr<MediaFormatReader> mReader;
 
-  bool mEnded;
+  Atomic<bool> mEnded;
 };
 
 } // namespace mozilla
 
 #endif /* MOZILLA_MEDIASOURCEDECODER_H_ */
--- a/dom/media/mediasource/SourceBuffer.cpp
+++ b/dom/media/mediasource/SourceBuffer.cpp
@@ -276,16 +276,19 @@ SourceBuffer::Detach()
 
 void
 SourceBuffer::Ended()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(IsAttached());
   MSE_DEBUG("Ended");
   mTrackBuffersManager->Ended();
+  // We want the MediaSourceReader to refresh its buffered range as it may
+  // have been modified (end lined up).
+  mMediaSource->GetDecoder()->NotifyDataArrived();
 }
 
 SourceBuffer::SourceBuffer(MediaSource* aMediaSource, const nsACString& aType)
   : DOMEventTargetHelper(aMediaSource->GetParentObject())
   , mMediaSource(aMediaSource)
   , mCurrentAttributes(aType.LowerCaseEqualsLiteral("audio/mpeg") ||
                        aType.LowerCaseEqualsLiteral("audio/aac"))
   , mUpdating(false)
--- a/testing/web-platform/meta/media-source/mediasource-play-then-seek-back.html.ini
+++ b/testing/web-platform/meta/media-source/mediasource-play-then-seek-back.html.ini
@@ -1,6 +1,4 @@
 [mediasource-play-then-seek-back.html]
   type: testharness
   prefs: [media.mediasource.enabled:true]
-  disabled:
-    if (os == "linux"): https://bugzilla.mozilla.org/show_bug.cgi?id=1293159
-
+  disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1128069
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/media-source/mediasource-seek-beyond-duration.html.ini
@@ -0,0 +1,10 @@
+[mediasource-seek-beyond-duration.html]
+  type: testharness
+  prefs: [media.mediasource.enabled:true]
+  disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1093945
+  [Test seeking beyond updated media duration.]
+    disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1093945
+
+  [Test seeking beyond media duration.]
+    disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1066467
+
--- a/testing/web-platform/tests/media-source/mediasource-play-then-seek-back.html
+++ b/testing/web-platform/tests/media-source/mediasource-play-then-seek-back.html
@@ -25,28 +25,28 @@
                     {
                         assert_greater_than(mediaElement.currentTime, 0.0, 'Playback has started after seek.');
                         test.done();
                     });
                 }
 
                 function finishSeekThenPlay()
                 {
+                    assert_true(mediaElement.seeking, 'mediaElement is seeking');
                     assert_equals(mediaElement.currentTime, 0.0, 'Current time is 0.0');
                     test.expectEvent(mediaElement, 'seeked', 'mediaElement finished seek');
 
                     test.waitForExpectedEvents(confirmPlayThenEnd);
                 }
 
                 function delayedPlayHandler()
                 {
                     assert_greater_than(mediaElement.currentTime, 0.0, 'Playback has started.');
                     test.expectEvent(mediaElement, 'seeking', 'mediaElement');
                     mediaElement.currentTime = 0.0;
-                    assert_true(mediaElement.seeking, 'mediaElement is seeking');
 
                     test.waitForExpectedEvents(finishSeekThenPlay);
                 }
 
                 test.waitForExpectedEvents(function()
                 {
                     test.waitForCurrentTimeChange(mediaElement, delayedPlayHandler);
                 });
--- a/testing/web-platform/tests/media-source/mediasource-seek-beyond-duration.html
+++ b/testing/web-platform/tests/media-source/mediasource-seek-beyond-duration.html
@@ -57,25 +57,16 @@
                     test.expectEvent(mediaElement, 'playing', 'Playing media.');
                     sourceBuffer.appendBuffer(playbackData);
                 });
 
                 test.waitForExpectedEvents(function()
                 {
                     assert_equals(mediaElement.duration, segmentInfo.duration);
                     assert_greater_than_equal(mediaElement.duration, 2.0, 'Duration is >2.0s.');
-
-                    test.expectEvent(sourceBuffer, "updateend");
-                    sourceBuffer.remove(1.5, Infinity);
-                    assert_true(sourceBuffer.updating, "updating");
-                });
-
-                test.waitForExpectedEvents(function()
-                {
-                    assert_false(sourceBuffer.updating, "updating");
                     test.waitForCurrentTimeChange(mediaElement, function()
                     {
                         // Update duration.
                         mediaSource.duration = 1.5;
                         seekToSpecifiedTimeSetEOSAndVerifyDone(test, mediaElement, mediaSource, 1.8);
                     });
                 });
             }, 'Test seeking beyond updated media duration.');