Bug 1427932. P2 - fix the calculation of |endTime|. r=jya

MozReview-Commit-ID: 2a8FxMdgM8e

--HG--
extra : rebase_source : a287b19c5c2d6d3c5a2fb454c14b390f60e63667
extra : source : 49211ab256d7742cf83b16e6a2fa6ed3d53f1b46
This commit is contained in:
JW Wang 2018-01-04 11:10:19 +08:00
parent b23b5d2214
commit 5efcbcb3a8

View File

@ -1054,7 +1054,7 @@ OggDemuxer::SeekInternal(TrackInfo::TrackType aType, const TimeUnit& aTarget)
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);
}