Bug 1427932. P2 - fix the calculation of |endTime|. r=jya
☠☠ backed out by b7790af77bfd ☠ ☠
authorJW Wang <jwwang@mozilla.com>
Thu, 04 Jan 2018 11:10:19 +0800
changeset 452825 fbae5269d99a3e117141126f09a495a8e516060f
parent 452824 8b7cc135f1a5915be747d4e8126ebacc3314c3cd
child 452826 b542c2c398bbde6096964a5b8d4ad806f3623017
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1427932
milestone59.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 1427932. P2 - fix the calculation of |endTime|. r=jya MozReview-Commit-ID: 2a8FxMdgM8e
dom/media/ogg/OggDemuxer.cpp
--- a/dom/media/ogg/OggDemuxer.cpp
+++ b/dom/media/ogg/OggDemuxer.cpp
@@ -1049,17 +1049,17 @@ OggDemuxer::FindStartTime(TrackInfo::Tra
 nsresult
 OggDemuxer::SeekInternal(TrackInfo::TrackType aType, const TimeUnit& aTarget)
 {
   int64_t target = aTarget.ToMicroseconds();
   OGG_DEBUG("About to seek to %" PRId64, target);
   nsresult res;
   int64_t adjustedTarget = target;
   int64_t startTime = StartTime(aType);
-  int64_t endTime = mInfo.mMetadataDuration->ToMicroseconds();
+  int64_t endTime = mInfo.mMetadataDuration->ToMicroseconds() + startTime;
   if (aType == TrackInfo::kAudioTrack && mOpusState){
     adjustedTarget = std::max(startTime, target - OGG_SEEK_OPUS_PREROLL);
   }
 
   if (!HaveStartTime(aType) || adjustedTarget == startTime) {
     // We've seeked to the media start or we can't seek.
     // Just seek to the offset of the first content page.
     res = Resource(aType)->Seek(nsISeekableStream::NS_SEEK_SET, 0);