Bug 1283785. Part 1 - remove the IsVideoRequestPending() check from EnsureVideoDecodeTaskQueued() r=kaku
1. EnsureVideoDecodeTaskQueued() is called from video callbaks where IsVideoRequestPending() is false.
2. EnsureVideoDecodeTaskQueued() is called from Seek() which checks IsVideoRequestPending() is false.
MozReview-Commit-ID: 59qu0Gh6nK7
--- a/dom/media/NextFrameSeekTask.cpp
+++ b/dom/media/NextFrameSeekTask.cpp
@@ -112,17 +112,17 @@ NextFrameSeekTask::Seek(const media::Tim
AssertOwnerThread();
auto currentTime = mCurrentTime;
DiscardFrames(mVideoQueue, [currentTime] (int64_t aSampleTime) {
return aSampleTime <= currentTime;
});
RefPtr<SeekTaskPromise> promise = mSeekTaskPromise.Ensure(__func__);
- if (NeedMoreVideo()) {
+ if (!IsVideoRequestPending() && NeedMoreVideo()) {
EnsureVideoDecodeTaskQueued();
}
MaybeFinishSeek(); // Might resolve mSeekTaskPromise and modify audio queue.
return promise;
}
bool
NextFrameSeekTask::IsVideoDecoding() const
@@ -133,17 +133,17 @@ NextFrameSeekTask::IsVideoDecoding() con
void
NextFrameSeekTask::EnsureVideoDecodeTaskQueued()
{
AssertOwnerThread();
SAMPLE_LOG("EnsureVideoDecodeTaskQueued isDecoding=%d status=%s",
IsVideoDecoding(), VideoRequestStatus());
- if (!IsVideoDecoding() || IsVideoRequestPending()) {
+ if (!IsVideoDecoding()) {
return;
}
RequestVideoData();
}
const char*
NextFrameSeekTask::VideoRequestStatus()