Bug 1371188 P1 - remove MFR::ShouldSkip()'s aSkipToNextKeyframe parameter; r=jya

MozReview-Commit-ID: 3w6QivBbjnl

--HG--
extra : rebase_source : 8b5b65ee58e3b7a943e81e8d0ca5b6fb5b2dc5bd
extra : source : 99e5165166bf7fe1cbfb883146700f57626c401e
This commit is contained in:
Kaku Kuo 2017-06-12 15:01:29 +08:00
Родитель 62c25ef8e2
Коммит 2b13f6092f
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -1539,14 +1539,15 @@ MediaFormatReader::GetDecoderData(TrackType aTrack)
} }
bool bool
MediaFormatReader::ShouldSkip(bool aSkipToNextKeyframe, MediaFormatReader::ShouldSkip(TimeUnit aTimeThreshold)
TimeUnit aTimeThreshold)
{ {
MOZ_ASSERT(HasVideo()); MOZ_ASSERT(HasVideo());
TimeUnit nextKeyframe; TimeUnit nextKeyframe;
nsresult rv = mVideo.mTrackDemuxer->GetNextRandomAccessPoint(&nextKeyframe); nsresult rv = mVideo.mTrackDemuxer->GetNextRandomAccessPoint(&nextKeyframe);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
return aSkipToNextKeyframe; // Only OggTrackDemuxer with video type gets into here.
// We don't support skip-to-next-frame for this case.
return false;
} }
return (nextKeyframe < aTimeThreshold return (nextKeyframe < aTimeThreshold
|| (mVideo.mTimeThreshold || (mVideo.mTimeThreshold
@ -1589,8 +1590,7 @@ MediaFormatReader::RequestVideoData(bool aSkipToNextKeyframe,
// Ensure we have no pending seek going as ShouldSkip could return out of date // Ensure we have no pending seek going as ShouldSkip could return out of date
// information. // information.
if (!mVideo.HasInternalSeekPending() if (!mVideo.HasInternalSeekPending() && ShouldSkip(aTimeThreshold)) {
&& ShouldSkip(aSkipToNextKeyframe, aTimeThreshold)) {
RefPtr<VideoDataPromise> p = mVideo.EnsurePromise(__func__); RefPtr<VideoDataPromise> p = mVideo.EnsurePromise(__func__);
SkipVideoDemuxToNextKeyFrame(aTimeThreshold); SkipVideoDemuxToNextKeyFrame(aTimeThreshold);
return p; return p;

Просмотреть файл

@ -155,7 +155,7 @@ private:
void Reset(TrackType aTrack); void Reset(TrackType aTrack);
void DropDecodedSamples(TrackType aTrack); void DropDecodedSamples(TrackType aTrack);
bool ShouldSkip(bool aSkipToNextKeyframe, media::TimeUnit aTimeThreshold); bool ShouldSkip(media::TimeUnit aTimeThreshold);
void SetVideoDecodeThreshold(); void SetVideoDecodeThreshold();