Bug 1349253 - modify the assertion; r?jwwang
While MDSM calls MFR::Seek(), MFR tries to do video seek first and then the audio seek.
Video-seek and audio-seek are applied sequentially, and if something wrong in video-seek,
MFR discards the whole seek operation without applying audio-seek.
video | audio |
waiting | waiting | What MDSM receives
-----------------------------------------------------------------------------
X | X | resove mSeekRequest
-----------------------------------------------------------------------------
O | X | reject mSeekRequest with type=VIDEO, error=WAITING
-----------------------------------------------------------------------------
X | O | reject mSeekRequest with type=AUDIO, error=WAITING
-----------------------------------------------------------------------------
O | O | reject mSeekRequest with type=VIDEO, error=WAITING
-----------------------------------------------------------------------------
So, here, AccurateSeekingState::OnSeekRejected() has a unified code to handle
WAITING_FOR_DATA error for both video and audio type, and it uses the
aReject.mType variable to distinguish different types.
But, it mixes the assertions. We should also apply assertions according to the
type that is in concern.
MozReview-Commit-ID: F7RpnFghcKk
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1282,20 +1282,21 @@ private:
}
void OnSeekRejected(const SeekRejectValue& aReject)
{
mSeekRequest.Complete();
if (aReject.mError == NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA) {
SLOG("OnSeekRejected reason=WAITING_FOR_DATA type=%d", aReject.mType);
- MOZ_ASSERT(!mMaster->IsRequestingAudioData());
- MOZ_ASSERT(!mMaster->IsRequestingVideoData());
- MOZ_ASSERT(!mMaster->IsWaitingAudioData());
- MOZ_ASSERT(!mMaster->IsWaitingVideoData());
+ MOZ_ASSERT_IF(aReject.mType == MediaData::AUDIO_DATA, !mMaster->IsRequestingAudioData());
+ MOZ_ASSERT_IF(aReject.mType == MediaData::VIDEO_DATA, !mMaster->IsRequestingVideoData());
+ MOZ_ASSERT_IF(aReject.mType == MediaData::AUDIO_DATA, !mMaster->IsWaitingAudioData());
+ MOZ_ASSERT_IF(aReject.mType == MediaData::VIDEO_DATA, !mMaster->IsWaitingVideoData());
+
// Fire 'waiting' to notify the player that we are waiting for data.
mMaster->UpdateNextFrameStatus(
MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE_SEEKING);
Reader()
->WaitForData(aReject.mType)
->Then(OwnerThread(), __func__,
[this](MediaData::Type aType) {
SLOG("OnSeekRejected wait promise resolved");