Closed Bug 1355031 Opened 7 years ago Closed 7 years ago

Make sure that VideoOnlySeekBegin and VideoOnlySeekCompleted are always dispatched in pair.

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: kaku, Assigned: kaku)

References

Details

Attachments

(2 files)

VideoOnlySeekBegin and VideoOnlySeekCompleted are used to notify the beginning and completion of the video-only seek operation. However, a seek operation could be canceled and we didn't dispatch VideoOnlySeekCompleted in that case. In this bug, we make sure that VideoOnlySeekBegin and VideoOnlySeekCompleted are always dispatched in pair.
Assignee: nobody → kaku
Status: NEW → ASSIGNED
Depends on: 1350852, 1354465
Priority: -- → P3
Comment on attachment 8856421 [details]
Bug 1355031 P1 - adjust the event order;

https://reviewboard.mozilla.org/r/128370/#review131180
Attachment #8856421 - Flags: review?(jwwang) → review+
Comment on attachment 8856422 [details]
Bug 1355031 P2 - make sure that VideoOnlySeekBegin and VideoOnlySeekCompleted are always dispatched in pair;

https://reviewboard.mozilla.org/r/128372/#review131184

::: dom/media/MediaDecoderStateMachine.cpp:1041
(Diff revision 1)
>      return SeekingState::Enter(Move(aSeekJob), aVisibility);
>    }
>  
>    void Exit() override
>    {
> +    if (mSeekJob.Exists() && mSeekJob.mTarget->IsVideoOnly()) {

Remove the |mSeekJob.Exists()| check, so you have only one place to dispatch event.

https://reviewboard-hg.mozilla.org/gecko/file/64fa714092c9/dom/media/MediaDecoderStateMachine.cpp#l2438
Attachment #8856422 - Flags: review?(jwwang) → review+
Comment on attachment 8856422 [details]
Bug 1355031 P2 - make sure that VideoOnlySeekBegin and VideoOnlySeekCompleted are always dispatched in pair;

https://reviewboard.mozilla.org/r/128372/#review131184

> Remove the |mSeekJob.Exists()| check, so you have only one place to dispatch event.
> 
> https://reviewboard-hg.mozilla.org/gecko/file/64fa714092c9/dom/media/MediaDecoderStateMachine.cpp#l2438

I found that we cannot do it, at least for now, because that, in SeekingState::SeekComplete(), we call `mSeekJob.Resolve()` which reset the `mSeekJob.mTarget` (http://searchfox.org/mozilla-central/rev/624d25b2980cf5f83452b040e6d664460f9b7ec5/dom/media/MediaDecoderStateMachine.cpp#2393-2398).

So, we need to dispatch the VideoOnlySeekCompleted event in both SeekingState::SeekComplete() and AccurateSeekingState::Exit(). Reasonable?

I think we should land this bug as it is and have another bug to refactor the way we store SeekTarget and the SeekPromise if we want.
Try looks good, let's check in, thanks for the review.
Pushed by tkuo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d9c4cea9d957
P1 - adjust the event order; r=jwwang
https://hg.mozilla.org/integration/autoland/rev/2df7d0984161
P2 - make sure that VideoOnlySeekBegin and VideoOnlySeekCompleted are always dispatched in pair; r=jwwang
https://hg.mozilla.org/mozilla-central/rev/d9c4cea9d957
https://hg.mozilla.org/mozilla-central/rev/2df7d0984161
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: