Closed
Bug 1242338
Opened 9 years ago
Closed 9 years ago
Seek a video to its duration should trigger "ended" event
Categories
(Core :: Audio/Video: Playback, defect, P2)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: kaku, Assigned: kaku, NeedInfo)
References
Details
Attachments
(3 files)
Seek a HTMLMediaElement to it's duration property should also finish the playback and then trigger the "ended" event. However, this is not the case in some video files. Please see the test patch.
Assignee | ||
Comment 1•9 years ago
|
||
The problem is that there is a numerical issue while transforming a double to a int64.
The duration of the test case is 4.137471 which is stored as a double. When we call seek(4.137471), the 4.137471 is transformed to an int64 and it becomes 4137470. (The operation is here: https://dxr.mozilla.org/mozilla-central/source/dom/media/MediaDecoder.cpp#809).
I will use the utilities functions of TimeUnits to solve it.
Assignee | ||
Comment 2•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/32263/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/32263/
Attachment #8711625 -
Flags: review?(jwwang)
Assignee | ||
Comment 3•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/32265/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/32265/
Attachment #8711626 -
Flags: review?(jwwang)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → tkuo
Updated•9 years ago
|
Priority: -- → P2
Summary: Seek a video to it's duration should trigger "ended" event. → Seek a video to its duration should trigger "ended" event
Comment 4•9 years ago
|
||
(In reply to Tzuhao Kuo [:kaku] from comment #0)
> Created attachment 8711570 [details] [diff] [review]
> test-patch.diff
>
> Seek a HTMLMediaElement to it's duration property should also finish the
> playback and then trigger the "ended" event. However, this is not the case
> in some video files. Please see the test patch.
Can't find the test in this attachment. Can you make it a mochitest?
Comment 5•9 years ago
|
||
Comment on attachment 8711626 [details]
MozReview Request: Bug1242338 - test cases; r=jwwang
https://reviewboard.mozilla.org/r/32265/#review29117
::: dom/media/test/test_bug1242338.html:42
(Diff revision 1)
> + video.src = "bug482461-theora.ogv";
Use MediaTestManager to test multiple files to increase test coverage.
Attachment #8711626 -
Flags: review?(jwwang)
Updated•9 years ago
|
Attachment #8711625 -
Flags: review?(jwwang) → review+
Comment 6•9 years ago
|
||
Comment on attachment 8711625 [details]
MozReview Request: Bug1242338 - fix numerical issue in MediaDecoder::Seek(); r=jwwang
https://reviewboard.mozilla.org/r/32263/#review29119
Assignee | ||
Comment 7•9 years ago
|
||
https://reviewboard.mozilla.org/r/32265/#review29117
> Use MediaTestManager to test multiple files to increase test coverage.
Okay.
Assignee | ||
Comment 8•9 years ago
|
||
Comment on attachment 8711626 [details]
MozReview Request: Bug1242338 - test cases; r=jwwang
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/32265/diff/1-2/
Attachment #8711626 -
Flags: review?(jwwang)
Assignee | ||
Comment 9•9 years ago
|
||
Comment on attachment 8711626 [details]
MozReview Request: Bug1242338 - test cases; r=jwwang
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/32265/diff/2-3/
Comment 10•9 years ago
|
||
Comment on attachment 8711626 [details]
MozReview Request: Bug1242338 - test cases; r=jwwang
https://reviewboard.mozilla.org/r/32265/#review29123
::: dom/media/test/test_bug1242338.html:14
(Diff revision 3)
> +SimpleTest.waitForExplicitFinish();
manager.runTests() will do this for you.
::: dom/media/test/test_bug1242338.html:57
(Diff revision 3)
> + is(test.name, video.name, test.name + ": Name should match in onLoadedmetadata()");
These lines copied from test_playback.html should be removed since they are not relavant to the purose of this test.
::: dom/media/test/test_bug1242338.html:74
(Diff revision 3)
> + if (video.seenSeeking && video.seenSeeked) {
I think this test can simply check if 'ended' event is fired without concerning 'seeking' and 'seeked'.
Attachment #8711626 -
Flags: review?(jwwang)
Assignee | ||
Comment 11•9 years ago
|
||
Comment on attachment 8711626 [details]
MozReview Request: Bug1242338 - test cases; r=jwwang
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/32265/diff/3-4/
Attachment #8711626 -
Flags: review?(jwwang)
Updated•9 years ago
|
Attachment #8711626 -
Flags: review?(jwwang) → review+
Comment 12•9 years ago
|
||
Comment on attachment 8711626 [details]
MozReview Request: Bug1242338 - test cases; r=jwwang
https://reviewboard.mozilla.org/r/32265/#review29129
::: dom/media/test/test_bug1242338.html:19
(Diff revision 4)
> + video.prevTime = 0;
prevTime not used at all.
::: dom/media/test/test_bug1242338.html:40
(Diff revision 4)
> + checkMetadata(test.name, video, test);
checkMetadata() is not relavant to this test.
Assignee | ||
Comment 13•9 years ago
|
||
Comment on attachment 8711626 [details]
MozReview Request: Bug1242338 - test cases; r=jwwang
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/32265/diff/4-5/
Assignee | ||
Updated•9 years ago
|
Attachment #8711625 -
Attachment description: MozReview Request: Bug1242338 - fix numerical issue in MediaDecoder::Seek(); r?jwwang → MozReview Request: Bug1242338 - fix numerical issue in MediaDecoder::Seek(); r=jwwang
Assignee | ||
Comment 14•9 years ago
|
||
Comment on attachment 8711625 [details]
MozReview Request: Bug1242338 - fix numerical issue in MediaDecoder::Seek(); r=jwwang
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/32263/diff/1-2/
Assignee | ||
Comment 15•9 years ago
|
||
Comment on attachment 8711626 [details]
MozReview Request: Bug1242338 - test cases; r=jwwang
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/32265/diff/5-6/
Attachment #8711626 -
Attachment description: MozReview Request: Bug1242338 - test cases; r?jwwang → MozReview Request: Bug1242338 - test cases; r=jwwang
Assignee | ||
Comment 16•9 years ago
|
||
Thanks for the review.
Try looks ok, https://treeherder.mozilla.org/#/jobs?repo=try&revision=fc4c803b677a.
Add checkin-needed.
Keywords: checkin-needed
Comment 17•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/69bb4ab3afc5
https://hg.mozilla.org/integration/mozilla-inbound/rev/ce532d96a0e2
Keywords: checkin-needed
Comment 18•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/69bb4ab3afc5
https://hg.mozilla.org/mozilla-central/rev/ce532d96a0e2
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Comment 19•9 years ago
|
||
Quick fly-by note.
The previous code was testing for overflow; this is what:
nsresult rv = SecondsToUsecs(aTime, timeUsecs);
NS_ENSURE_SUCCESS(rv, rv);
was doing.
Doing:
timeUsecs = TimeUnit::FromSeconds(aTime).ToMicroseconds()
is *not* equivalent ; this will assert should an overflow internally occurs in TimeUnit::FromSeconds()
The replacement code should have been something like:
TimeUnit time = TimeUnit::FromSeconds(aTime);
if (!time.IsValid()) {
return NS_ERROR_FAILURE;
}
timeUsecs = time.ToMicroseconds();
Flags: needinfo?(tkuo)
Flags: needinfo?(jwwang)
Comment 20•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/file/584870f1cbc5d060a57e147ce249f736956e2b62/dom/media/TimeUnits.h#l58
It is rounded down to INT64_MAX so time.IsValid() is always true. Maybe it should call Invalid() for the case.
Flags: needinfo?(jwwang)
You need to log in
before you can comment on or make changes to this bug.
Description
•