Closed Bug 1294615 Opened 8 years ago Closed 8 years ago

Simplify the code of MediaDecoderStateMachine::SetDormant()

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

References

Details

Attachments

(2 files)

We will prove mQueuedSeek.Exists() is always false and mCurrentSeek.Exists() is always true when seek is is action. This allows us to remove some checks from SetDormant() to simplify the code.
Assignee: nobody → jwwang
Blocks: 1286129
Priority: -- → P3
Attachment #8780389 - Flags: review?(kaku)
Attachment #8780390 - Flags: review?(kaku)
Comment on attachment 8780389 [details]
Bug 1294615. Part 1 - Assert mQueuedSeek.Exists() is false in InitiateSeek().

https://reviewboard.mozilla.org/r/71114/#review68618
Attachment #8780389 - Flags: review?(kaku) → review+
Comment on attachment 8780390 [details]
Bug 1294615. Part 2 - Refactor MDSM::SetDormant() to remove unnecessary checks for mQueuedSeek.Exists() and mCurrentSeek.Exists().

https://reviewboard.mozilla.org/r/71116/#review68624

::: dom/media/MediaDecoderStateMachine.cpp
(Diff revision 1)
> -        // are handled.
> +      // are handled.
> -        if (mCurrentSeek.mTarget.IsVideoOnly()) {
> +      if (mCurrentSeek.mTarget.IsVideoOnly()) {
> -          mCurrentSeek.mTarget.SetType(SeekTarget::Accurate);
> +        mCurrentSeek.mTarget.SetType(SeekTarget::Accurate);
> -        }
> +      }
> -        mQueuedSeek = Move(mCurrentSeek);
> +      mQueuedSeek = Move(mCurrentSeek);
> -        mSeekTaskRequest.DisconnectIfExists();

Shouldn't we still disconnect mSeekRequest? Otherwise we will hit the assertion of |mState == DECODER_STATE_SEEKING| in OnSeekTaskResolved()/OnSeekTaskRejected().
Attachment #8780390 - Flags: review?(kaku) → review-
Comment on attachment 8780390 [details]
Bug 1294615. Part 2 - Refactor MDSM::SetDormant() to remove unnecessary checks for mQueuedSeek.Exists() and mCurrentSeek.Exists().

https://reviewboard.mozilla.org/r/71116/#review68624

> Shouldn't we still disconnect mSeekRequest? Otherwise we will hit the assertion of |mState == DECODER_STATE_SEEKING| in OnSeekTaskResolved()/OnSeekTaskRejected().

It is already done in Reset().
Comment on attachment 8780390 [details]
Bug 1294615. Part 2 - Refactor MDSM::SetDormant() to remove unnecessary checks for mQueuedSeek.Exists() and mCurrentSeek.Exists().

https://reviewboard.mozilla.org/r/71116/#review68636
Attachment #8780390 - Flags: review?(kaku) → review+
Thanks!
Pushed by jwwang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/da868fdc53aa
Part 1 - Assert mQueuedSeek.Exists() is false in InitiateSeek(). r=kaku
https://hg.mozilla.org/integration/autoland/rev/d4ac66433eeb
Part 2 - Refactor MDSM::SetDormant() to remove unnecessary checks for mQueuedSeek.Exists() and mCurrentSeek.Exists(). r=kaku
https://hg.mozilla.org/mozilla-central/rev/da868fdc53aa
https://hg.mozilla.org/mozilla-central/rev/d4ac66433eeb
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: