fix: Keep TTML subtitles visible until their end time when they extend past a segment#10264
Open
abolfazl-moeini wants to merge 1 commit into
Open
Conversation
…d past a segment On DASH streams with fragmented MP4 TTML subtitle tracks, cues that have an explicit end time extending past the current segment boundary were clipped to the segment end. This caused them to disappear early. A prior change to avoid duplicates (shaka-project#4631) clipped both start and end. This patch only clips the start (for cues continuing from a prior segment) and relies on strict-subset deduplication at display time to suppress duplicates when the same cue payload is present in adjacent segments. The HLS path is unchanged. Fixes shaka-project#10172
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Collaborator
|
Bundle Size Report for PR #10264
|
Collaborator
|
Incremental code coverage: 97.37% |
Member
|
The behavior is changing because the layout tests are failing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
On DASH streams using fragmented MP4 containers for TTML subtitles, cues with an explicit
endattribute that extends past the current segment boundary were being clipped atsegmentEnd. This caused subtitles to disappear roughly 0.7 s early in the reported case (and similar for other streams).ExoPlayer / Media3 handles these cues correctly.
Root cause and changes
A previous fix for duplicate cues across segments (#4631) applied:
for non-HLS content. While this eliminated duplicates, it also truncated cues that legitimately continue past the segment and are not repeated in the following segment.
This patch:
shaka.text.Utils.isCueStrictSubset+ logic inUITextDisplayer.append()so that when the full cue and a tail copy both arrive we only keep the longer one and avoid on-screen duplicates (preserving the EBU subtitles regression in 4.1.3 - duplicate line on screen #4631 behaviour).Testing
python3 build/check.py— clean.python3 build/test.py --quick --filter="trims cues to segment boundaries|isCueStrictSubset" --uncompiled— 8/8 passing on Chrome & Edge (other browser launcher failures are local env only).Fixes #10172