Bug 1272964: P1. Only activate skip to next keyframe logic when next keyframe time is known. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 17 May 2016 22:26:34 +0800
changeset 298248 6f15eecb6ba1198798bfbaf34391fd0344d2930c
parent 298247 3c46096adeaf7611bed1588d6adfa0c7c7b2d5e3
child 298249 13fd3929f83accddd4e8d0154c22bef55431118c
push id77085
push userjyavenard@mozilla.com
push dateSat, 21 May 2016 00:13:46 +0000
treeherdermozilla-inbound@1da7e78b6d35 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1272964
milestone49.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 1272964: P1. Only activate skip to next keyframe logic when next keyframe time is known. r=gerald MozReview-Commit-ID: DoAstqSRnyc
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -499,17 +499,17 @@ MediaFormatReader::ShouldSkip(bool aSkip
   media::TimeUnit nextKeyframe;
   nsresult rv = mVideo.mTrackDemuxer->GetNextRandomAccessPoint(&nextKeyframe);
   if (NS_FAILED(rv)) {
     return aSkipToNextKeyframe;
   }
   return (nextKeyframe < aTimeThreshold ||
           (mVideo.mTimeThreshold &&
            mVideo.mTimeThreshold.ref().mTime < aTimeThreshold)) &&
-         nextKeyframe.ToMicroseconds() >= 0;
+         nextKeyframe.ToMicroseconds() >= 0 && !nextKeyframe.IsInfinite();
 }
 
 RefPtr<MediaDecoderReader::MediaDataPromise>
 MediaFormatReader::RequestVideoData(bool aSkipToNextKeyframe,
                                     int64_t aTimeThreshold)
 {
   MOZ_ASSERT(OnTaskQueue());
   MOZ_DIAGNOSTIC_ASSERT(mSeekPromise.IsEmpty(), "No sample requests allowed while seeking");