OCTO-11531 - #392
Merged
Merged
Conversation
dynamic frame rate.
- detect() now requires both <tt[\s>] and </tt> (regex) instead of
naive substring check, eliminating false positives on non-TTML content.
- Implement TTML tick metric (Nt): read ttp:tickRate from <tt>,
default to frameRate × subFrameRate per spec §8.2.12.
- Read ttp:frameRate and ttp:frameRateMultiplier from <tt> instead of
hardcoding 30fps. Raise CaptionReadSyntaxError on malformed or zero
values.
- Add constants DFXP_DEFAULT_FRAMERATE, DFXP_DEFAULT_FRAMERATE_MULTIPLIER,
DFXP_DEFAULT_SUBFRAMERATE, DFXP_DEFAULT_TICKRATE.
Based on the dynamic framerate approach from PR #292 by Marcel Porta Vallés.
Co-Authored-By: Marcel Porta Vallés <Marcelpv96@users.noreply.github.com>
🟡 PR Compliance ReviewRisk Level: MEDIUM
REVIEW REQUIRED - Address issues before merging Full report available in workflow artifacts |
dianadersedan
approved these changes
Jul 23, 2026
panasicov
approved these changes
Jul 23, 2026
lorandvarga
approved these changes
Jul 23, 2026
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.
Summary
detect()** — uses regex<tt[\s>]+</tt>instead of naive"</tt>" in content, eliminating false positives on non-TTML content that happens to contain the closing tag.Nt) usingttp:tickRatefrom<tt>, defaulting toframeRate × subFrameRateper TTML spec §8.2.12 (previously raisedNotImplementedError).ttp:frameRateandttp:frameRateMultiplierfrom<tt>instead of hardcoding 30fps. RaisesCaptionReadSyntaxErroron malformed or zero values. Incorporates the approach from PR Dynamic FPS selection on DFXPReader #292 by @Marcelpv96.Backwards compatibility
Default values (
frameRate=30,multiplier="1 1",subFrameRate=1,tickRate=30) preserve existing behavior for documents without these attributes. The only behavioral change is that tick timestamps (Nt) now parse successfully instead of raisingNotImplementedError.Test plan
CaptionReadSyntaxErrorCaptionReadSyntaxErrorCaptionReadSyntaxErrordetect()rejects content with only</tt>(no opening tag)