Backed out 2 changesets (bug 1487797) for introducing regressions a=backout
authorNoemi Erli <nerli@mozilla.com>
Tue, 16 Oct 2018 00:23:11 +0300
changeset 499812 b569fad5a51ff187f7a03e584ba3e5910e0f19ee
parent 499667 973e173fa9aa168f9bbfd7b2e381fd90aa60cf0f
child 499813 c1ee6c65f85b0ea68006a3802db0937220d55da3
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1487797
milestone64.0a1
backs oute9549537063a3b1212c45420b868bcc7d6207be3
c629e51dda100bbde42b75776868af9a219dc8ed
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
Backed out 2 changesets (bug 1487797) for introducing regressions a=backout Backed out changeset e9549537063a (bug 1487797) Backed out changeset c629e51dda10 (bug 1487797)
dom/media/ReaderProxy.cpp
dom/media/ReaderProxy.h
--- a/dom/media/ReaderProxy.cpp
+++ b/dom/media/ReaderProxy.cpp
@@ -57,19 +57,18 @@ RefPtr<ReaderProxy::AudioDataPromise>
 ReaderProxy::OnAudioDataRequestCompleted(RefPtr<AudioData> aAudio)
 {
   MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
 
   // Subtract the start time and add the looping-offset time.
   int64_t offset =
     StartTime().ToMicroseconds() - mLoopingOffset.ToMicroseconds();
   aAudio->AdjustForStartTime(offset);
-  if (aAudio->mTime.IsValid() && aAudio->GetEndTime().IsValid() &&
-      CorrectTimeOfAudioDataIfNeeded(aAudio)) {
-    UpdateLastAudioEndTime(aAudio);
+  if (aAudio->mTime.IsValid()) {
+    mLastAudioEndTime = aAudio->mTime;
     return AudioDataPromise::CreateAndResolve(aAudio.forget(), __func__);
   }
   return AudioDataPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR,
                                            __func__);
 }
 
 RefPtr<ReaderProxy::AudioDataPromise>
 ReaderProxy::OnAudioDataRequestFailed(const MediaResult& aError)
@@ -110,38 +109,16 @@ ReaderProxy::OnAudioDataRequestFailed(co
            [self](RefPtr<AudioData> aAudio) {
              return self->OnAudioDataRequestCompleted(aAudio.forget());
            },
            [](const MediaResult& aError) {
              return AudioDataPromise::CreateAndReject(aError, __func__);
            });
 }
 
-bool
-ReaderProxy::CorrectTimeOfAudioDataIfNeeded(const RefPtr<AudioData>& aAudio)
-{
-  MOZ_ASSERT(aAudio->mTime.IsValid() && mLastAudioEndTime.IsValid());
-  // The start time of the current audio data should be greater than the end
-  // time of the previous audio data.
-  if (aAudio->mTime < mLastAudioEndTime) {
-    aAudio->mTime = mLastAudioEndTime;
-  }
-  return aAudio->GetEndTime().IsValid();
-}
-
-void
-ReaderProxy::UpdateLastAudioEndTime(const AudioData* aAudio)
-{
-  MOZ_ASSERT(aAudio);
-  MOZ_ASSERT(aAudio->GetEndTime().IsValid() && mLastAudioEndTime.IsValid());
-  // Make sure the end time of the audio data are non-decreasing.
-  MOZ_ASSERT(aAudio->GetEndTime() >= mLastAudioEndTime);
-  mLastAudioEndTime = aAudio->GetEndTime();
-}
-
 RefPtr<ReaderProxy::AudioDataPromise>
 ReaderProxy::RequestAudioData()
 {
   MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
   MOZ_ASSERT(!mShutdown);
 
   mSeamlessLoopingBlocked = false;
   return InvokeAsync(mReader->OwnerThread(),
--- a/dom/media/ReaderProxy.h
+++ b/dom/media/ReaderProxy.h
@@ -95,22 +95,16 @@ private:
   void UpdateDuration();
   RefPtr<SeekPromise> SeekInternal(const SeekTarget& aTarget);
 
   RefPtr<ReaderProxy::AudioDataPromise> OnAudioDataRequestCompleted(
     RefPtr<AudioData> aAudio);
   RefPtr<ReaderProxy::AudioDataPromise> OnAudioDataRequestFailed(
     const MediaResult& aError);
 
-  // Make sure the timestamp of the audio data increase monotonically by
-  // adjusting it according to mLastAudioEndTime. Returns true if the
-  // endtime is valid after correction and false otherwise.
-  bool CorrectTimeOfAudioDataIfNeeded(const RefPtr<AudioData>& aAudio);
-  void UpdateLastAudioEndTime(const AudioData* aAudio);
-
   const RefPtr<AbstractThread> mOwnerThread;
   const RefPtr<MediaFormatReader> mReader;
 
   bool mShutdown = false;
   Maybe<media::TimeUnit> mStartTime;
 
   // State-watching manager.
   WatchManager<ReaderProxy> mWatchManager;