Bug 1324371. Part 6 - assert |VideoQueue().AtEndOfStream()|. r?kaku
UpdateSeekTargetTime() is called only when NeedMoreVideo() is false.
if |data| is null, both |VideoQueue().IsFinished()| and |VideoQueue().GetSize() == 0| must be true
and therefore |VideoQueue().AtEndOfStream()| must also be true.
MozReview-Commit-ID: DZKiVtt6iIM
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1442,20 +1442,19 @@ private:
// 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()) {
+ } else {
+ MOZ_ASSERT(VideoQueue().AtEndOfStream());
mSeekJob.mTarget->SetTime(mDuration);
- } else {
- MOZ_ASSERT(false, "No data!");
}
}
void FinishSeek()
{
MOZ_ASSERT(!NeedMoreVideo());
UpdateSeekTargetTime();
auto time = mSeekJob.mTarget->GetTime().ToMicroseconds();