Repository navigation
fix: default DFXP tick rate to 1 when no frame rate is given - #472
Open
kevincommits wants to merge 1 commit into
Open
kevincommits wants to merge 1 commit into
kevincommits wants to merge 1 commit into
Conversation
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.
DFXPReader reads tick times (
5t) 30 times too fast when the document sets neitherttp:tickRatenorttp:frameRate.Today this prints
166666 400000. Expected is5000000 12000000. TTML1 section 6.2.10 (ttp:tickRate) says that when no frame rate is specified either, the tick rate is one tick per second of media time. The repo's ownai_artifacts/specs/dfxp/dfxp_specs_summary.md(RULE-PAR-005) says the same.Tick support came in with #392, which computes the default as frameRate x subFrameRate and applies the 30 fps default frame rate even when the document has no
ttp:frameRate. This pull request changes that one case, so please say if 30 was wanted there.The fix uses
frameRate x subFrameRateonly whenttp:frameRateis present on<tt>and falls back to 1 otherwise. Documents with an explicitttp:tickRateorttp:frameRateread exactly as before, and frame-based times still default to 30 fps.DFXP_DEFAULT_TICKRATE, the value a reader holds before it reads a document, is untouched.The new test in
tests/test_dfxp.pyreads a document with tick times and no rate parameters and checks the begin and end times. It fails on main and passes with the fix.Ran:
pytest(1429 passed, Python 3.12), andpre-commit run --fileson the two changed files (ruff and ruff-format pass).Not run: the Docker-based
run_tests.shand the Python 3.10 and 3.11 jobs.The version bump and changelog are left to you, as on earlier outside fixes.