Bug 1324371. Part 3 - inline IsVideoRequestPending() which has only one caller. r?kaku
MozReview-Commit-ID: 7bBDRQV9zJ1
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1273,17 +1273,19 @@ public:
private:
void DoSeekInternal()
{
auto currentTime = mCurrentTime;
DiscardFrames(VideoQueue(), [currentTime] (int64_t aSampleTime) {
return aSampleTime <= currentTime;
});
- if (!IsVideoRequestPending() && NeedMoreVideo()) {
+ if (NeedMoreVideo() &&
+ !Reader()->IsRequestingVideoData() &&
+ !Reader()->IsWaitingVideoData()) {
RequestVideoData();
}
MaybeFinishSeek(); // Might resolve mSeekTaskPromise and modify audio queue.
}
class AysncNextFrameSeekTask : public Runnable
{
@@ -1446,21 +1448,16 @@ private:
bool NeedMoreVideo() const
{
// Need to request video when we have none and video queue is not finished.
return VideoQueue().GetSize() == 0 &&
!VideoQueue().IsFinished();
}
- bool IsVideoRequestPending() const
- {
- return Reader()->IsRequestingVideoData() || Reader()->IsWaitingVideoData();
- }
-
// Update the seek target's time before resolving this seek task, the updated
// time will be used in the MDSM::SeekCompleted() to update the MDSM's position.
void UpdateSeekTargetTime()
{
RefPtr<MediaData> data = VideoQueue().PeekFront();
if (data) {
mSeekJob.mTarget->SetTime(TimeUnit::FromMicroseconds(data->mTime));
} else if (VideoQueue().AtEndOfStream()) {