Bug 1427932. P2 - fix the calculation of |endTime|.
MozReview-Commit-ID: 2a8FxMdgM8e
--- 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);