Open Bug 1386489 Opened 7 years ago Updated 2 years ago

media.ended is false after seeking to the end of the resource

Categories

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

defect

Tracking

()

REOPENED

People

(Reporter: jwwang, Unassigned)

References

Details

Attachments

(2 files)

      No description provided.
Attached video sine.webm
Assignee: nobody → jwwang
Status: NEW → ASSIGNED
Add a test case to demonstrate the issue.

Note this bug depends on the CPU scheduling and is very hard to reproduce. I found it slightly reproducible using rr with chaos mode.

./mach run path-to-the-html-file --disable-e10s --debugger=rr --debugger-args="record --chaos"
This should be the root cause of bug 1367955.
Blocks: 1367955
This bug is a regression of bug 1317576.

When we seek to the end of the resource, MDSM will:
1. resolve the seek promise which will call HTMLMediaElement::SeekCompleted()
2. dispatch MediaDecoder::PlaybackEnded() to the main thread.

There is a race between:
a. HTMLMediaElement::SeekCompleted() queues a 'seeked' event.
b. MDSM queues an event (in the main thread event queue) to run MediaDecoder::PlaybackEnded().

If a. comes first, the 'seeked' handler will see media.ended==false.

We should kinda revert bug 1317576 P2 to pass a flag to the resolve value of the seek promise to indicate seeking has reached the end. Then MediaDecoder will transition to ENDED before 'seeked' is fired.
Blocks: 1317576
Blocks: 1385699
Priority: -- → P3
Well, it turns out that Chrome fails the test case immediately. Come to think about it again, since metadata can lie about the duration and duration can change dynamically during playback, we can't just assume playback will reach the end in the 'seeked' handler by doing |v.currentTime = v.duration|.

I will mark this bug as INVALID.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
I opened an issue in the whatwg group: https://github.com/whatwg/html/issues/2885

Let's wait for the discussion to reach a conclusion.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: suro001 → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: