Bug 1309516 part 2 - replace MediaFormatReader::DemuxStartTime() with MediaInfo::mStartTime; r=jya
☠☠ backed out by fb72036436f9 ☠ ☠
authorKaku Kuo <kaku@mozilla.com>
Fri, 14 Oct 2016 17:09:04 +0800
changeset 320045 970694b0b279af4ae538998ff1900a00703c63ca
parent 320044 90409a433f31784609b4bcb1f421ec3963c816ed
child 320046 e39be827b2200e44f51bbbf12de370ee71ed07cb
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)
reviewersjya
bugs1309516
milestone52.0a1
Bug 1309516 part 2 - replace MediaFormatReader::DemuxStartTime() with MediaInfo::mStartTime; r=jya MozReview-Commit-ID: JzO0Yv33ljL
dom/media/MediaFormatReader.cpp
dom/media/MediaFormatReader.h
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1711,37 +1711,23 @@ MediaFormatReader::SetSeekTarget(const S
 {
   MOZ_ASSERT(OnTaskQueue());
 
   SeekTarget target = aTarget;
 
   // Transform the seek target time to the demuxer timeline.
   if (!ForceZeroStartTime()) {
     target.SetTime(aTarget.GetTime() - TimeUnit::FromMicroseconds(StartTime())
-                   + DemuxStartTime());
+                   + mInfo.mStartTime);
   }
 
   mOriginalSeekTarget = target;
   mFallbackSeekTime = mPendingSeekTime = Some(target.GetTime());
 }
 
-TimeUnit
-MediaFormatReader::DemuxStartTime()
-{
-  MOZ_ASSERT(OnTaskQueue());
-  MOZ_ASSERT(!ForceZeroStartTime());
-  MOZ_ASSERT(HasAudio() || HasVideo());
-
-  const TimeUnit startTime =
-    std::min(mAudio.mFirstDemuxedSampleTime.refOr(TimeUnit::FromInfinity()),
-             mVideo.mFirstDemuxedSampleTime.refOr(TimeUnit::FromInfinity()));
-
-  return startTime.IsInfinite() ? TimeUnit::FromMicroseconds(0) : startTime;
-}
-
 void
 MediaFormatReader::ScheduleSeek()
 {
   if (mSeekScheduled) {
     return;
   }
   mSeekScheduled = true;
   OwnerThread()->Dispatch(NewRunnableMethod(this, &MediaFormatReader::AttemptSeek));
--- a/dom/media/MediaFormatReader.h
+++ b/dom/media/MediaFormatReader.h
@@ -544,17 +544,16 @@ private:
   // Set to true if any of our track buffers may be blocking.
   bool mTrackDemuxersMayBlock;
 
   // Set the demuxed-only flag.
   Atomic<bool> mDemuxOnly;
 
   // Seeking objects.
   void SetSeekTarget(const SeekTarget& aTarget);
-  media::TimeUnit DemuxStartTime();
   bool IsSeeking() const { return mPendingSeekTime.isSome(); }
   bool IsVideoSeeking() const
   {
     return IsSeeking() && mOriginalSeekTarget.IsVideoOnly();
   }
   void ScheduleSeek();
   void AttemptSeek();
   void OnSeekFailed(TrackType aTrack, const MediaResult& aError);