MSE: Fix rare flaky changeType-play-* failures #29052
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unless the app explicitly sets
mediaSource.duration
,HTMLMediaElement.duration
remains NaN until initial HAVE_METADATA isreached, even if the attached mediaSource has already buffered media
well beyond the initialization segment(s) necessary to begin transition
to HAVE_METADATA. In Chromium, that transition is begun asynchronously,
letting thread hop through the pipeline thread complete while letting
the app continue. Eventually, the media element transitions, but in the
interim, its value for duration could still be NaN, even if mediaSource
has a duration value.
This change relaxes the changeType-play-* utility's reliance on strict
matching of mediaElement.duration and mediaSource.duration, instead
relying on the latter for use in trimming the buffered duration.
I've filed MSE spec issue #275 to discuss this behavior:
w3c/media-source#275
This change also reports more details in changeType web-test assertion
failures, which also enabled finding the suspected root cause of the
tests' flakiness.
Bug: 1184745
Change-Id: I208cbfbbc60776366a16b6a3e79f52480df5be37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2906776
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886148}