Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media source duration change algorithm (step 2 in particular) #3232

Closed

Conversation

tidoust
Copy link
Contributor

@tidoust tidoust commented Jun 24, 2016

New test cases ensure that implementations throw an InvalidStateError exception when the new duration is less than the highest starting presentation timestamp of any buffered coded frames.

Some test cases took for granted that setting the duration would set the SourceBuffer.updating attribute. This is no longer the case. Tests updated accordingly.

One the test cases assumed that endOfStream() could only adjust the duration downwards. That seems no longer true either.

Also, some duration tests assumed that a "timeupdate" event would only be fired after the "seeking" event. However, "timeupdate" events are regularly issued during playback and thus such an event could fire before the "seeking" event.

The test cases buffer media data around a specific presentation timestamp,
either by loading the right media segment, or by using the append window
mechanism, and then truncate the duration to appropriate values.
New test cases ensure that implementations throw an InvalidStateError exception
when the new duration is less than the highest starting presentation timestamp
of any buffered coded frames.

Some test cases took for granted that setting the duration would set the
SourceBuffer.updating attribute. This is no longer the case. Tests updated
accordingly.

One the test cases assumed that endOfStream() could only adjust the duration
downwards. That is no longer true either.

Also, some duration tests assumed that a "timeupdate" event would only be fired
after the "seeking" event. However, "timeupdate" events are regularly issued
during playback and thus such an evet could fire *before* the "seeking" event.
@wpt-pr-bot
Copy link
Collaborator

Reviewers for this pull request are: @acolwell, @bit, @shishimaru, @sideshowbarker, and @wolenetz.

@hoppipolla-critic-bot
Copy link

Critic review: https://critic.hoppipolla.co.uk/r/6661

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

Some tests expected the API to allow the truncation of the media content
duration even if that truncated a buffered range. The spec no longer allows
that behavior. See related discussion in:
w3c/media-source#102 (comment)

This update drops some tests on seeking after truncation, they seem no longer
relevant.
@wolenetz
Copy link
Member

FF folks landed a conflicting change. I'll work through such conflict after reviewing the rest of these PRs from @tidoust.

FYI-@jyavenard and @tidoust: Chromium change https://codereview.chromium.org/2102323002 also updated (probably with similar conflicts) related tests to accommodate the spec change to disallow duration truncating whole coded frames, and to disallow aborting range removals.

@jyavenard
Copy link
Contributor

Let me know if you need a hand to resolve such conflicts.

The commit that changed the test is 23b22d8

@jyavenard
Copy link
Contributor

i believe this commit may no longer be necessary as the test was fixed in push ac5ec11

@wolenetz
Copy link
Member

wolenetz commented Sep 7, 2016

I'm reviewing this now. Per #3232 (comment), this may now be redundant.

test.waitForExpectedEvents(function()
{
assert_false(sourceBuffer.updating, "updating");
assert_less_than(mediaSource.duration, 5, "duration");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current mediasource-config-changes.js uses explicit remove(2,...) and is more complete. This part of the this change is done better by current test.

@wolenetz
Copy link
Member

wolenetz commented Sep 7, 2016

There are some parts of this PR which include some new coverage; other parts regress or conflict with similar fixes already made. I'll update this PR to just include the new pieces of coverage noted in my diff comments, above.

-edit: I'll make a new PR, since this one originated in @tidoust's private fork.

wolenetz added a commit to wolenetz/web-platform-tests that referenced this pull request Sep 7, 2016
…tests#3232

Original author of some of this new coverage is @tidoust.
This commit replaces those in PR web-platform-tests#3232, which had become highly
conflicting with fixes to mediasource-duration.html and others which
landed while web-platform-tests#3232 was in review.

This commit also includes further coverage beyond web-platform-tests#3232.
@wolenetz
Copy link
Member

wolenetz commented Sep 7, 2016

#3655 is the replacement PR I've put together. Thank you, @tidoust, for putting together the original one.

@wolenetz wolenetz closed this Sep 7, 2016
wolenetz added a commit that referenced this pull request Sep 7, 2016
…age_per_review_of_pr_3232

Add duration coverage found missing during review of PR #3232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants