Bug 1371188 P1 - remove MFR::ShouldSkip()'s aSkipToNextKeyframe parameter; r?jya
MozReview-Commit-ID: 3w6QivBbjnl
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1534,24 +1534,25 @@ MediaFormatReader::GetDecoderData(TrackT
|| aTrack == TrackInfo::kVideoTrack);
if (aTrack == TrackInfo::kAudioTrack) {
return mAudio;
}
return mVideo;
}
bool
-MediaFormatReader::ShouldSkip(bool aSkipToNextKeyframe,
- TimeUnit aTimeThreshold)
+MediaFormatReader::ShouldSkip(TimeUnit aTimeThreshold)
{
MOZ_ASSERT(HasVideo());
TimeUnit nextKeyframe;
nsresult rv = mVideo.mTrackDemuxer->GetNextRandomAccessPoint(&nextKeyframe);
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
|| (mVideo.mTimeThreshold
&& mVideo.mTimeThreshold.ref().EndTime() < aTimeThreshold))
&& nextKeyframe.ToMicroseconds() >= 0
&& !nextKeyframe.IsInfinite();
}
@@ -1584,18 +1585,17 @@ MediaFormatReader::RequestVideoData(bool
if (mShutdown) {
NS_WARNING("RequestVideoData on shutdown MediaFormatReader!");
return VideoDataPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_CANCELED,
__func__);
}
// Ensure we have no pending seek going as ShouldSkip could return out of date
// information.
- if (!mVideo.HasInternalSeekPending()
- && ShouldSkip(aSkipToNextKeyframe, aTimeThreshold)) {
+ if (!mVideo.HasInternalSeekPending() && ShouldSkip(aTimeThreshold)) {
RefPtr<VideoDataPromise> p = mVideo.EnsurePromise(__func__);
SkipVideoDemuxToNextKeyFrame(aTimeThreshold);
return p;
}
RefPtr<VideoDataPromise> p = mVideo.EnsurePromise(__func__);
ScheduleUpdate(TrackInfo::kVideoTrack);
--- a/dom/media/MediaFormatReader.h
+++ b/dom/media/MediaFormatReader.h
@@ -150,17 +150,17 @@ private:
void ExtractCryptoInitData(nsTArray<uint8_t>& aInitData);
// Initializes mLayersBackendType if possible.
void InitLayersBackendType();
void Reset(TrackType aTrack);
void DropDecodedSamples(TrackType aTrack);
- bool ShouldSkip(bool aSkipToNextKeyframe, media::TimeUnit aTimeThreshold);
+ bool ShouldSkip(media::TimeUnit aTimeThreshold);
void SetVideoDecodeThreshold();
size_t SizeOfQueue(TrackType aTrack);
RefPtr<PDMFactory> mPlatform;
enum class DrainState