[video-rvfc] Fix src switch after 1 frame issue #29023
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.
Since we don't reset |last_presented_frame_| when switching sources on
a video element, if we update video.src from the first rVFC callback,
the first frame of the src will appear to be "stale". This is because
its |presented_frames| matches |last_presented_frames_| (with a value of
1, but it could technically happen with any number). This results in the
rVFC callback never running, and is especially easy to run into when
writing tests, which will time out.
This CL fixes the issue by clearing |last_presented_frame_| when the
video element's media player is cleared.
It also adds a WPT that switches between two video sources.
Bug: 1201211
Change-Id: I80519c1b19adcbb97ebcd94202e7df1df685d240
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2901601
Auto-Submit: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Thomas Guilbert <tguilbert@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#884026}