Repository navigation
pt_api v1.6.1 — Exact frame rates and timecode fixes
Exact frame rates and timecode fixes
Thank you to KatzZero (@katzzero) for identifying the ambiguous frame-rate field and contributing the exact-rate research and proposed 19-rate table. This release adapts that contribution to the current codebase, with additional corrections and regression coverage.
Fixes and improvements
- Exact session frame rates: read the complete little-endian UInt32 at payload offset
+40in0x204d, rather than its ambiguous family byte. Correctly distinguish 24 from 48 fps and 23.976 from 47.952 fps. - 19 rate enums: extend timecode conversion to the documented non-drop and drop-frame variants of 23.976, 24, 25, 29.97, 30, 47.952, 48, 50, 59.94, 60, 100, 119.88 and 120 fps.
- High-rate drop-frame: skip two, four or eight frame numbers at nominal rates 30, 60 and 120 respectively, except every tenth minute. Correct both conversion directions and reject nonexistent labels.
- Consistent timeline validation:
move_clip()andsplit_clip()use the engine's nominal frame rate and drop-frame rules, accepting the last valid frame number at fractional rates. - Exact rounding: rational arithmetic avoids one-sample floating-point rounding errors at long positions.
- Safe metadata handling: preserve unknown fields and complete unknown enums; accept variable-length payloads when the exact-rate field is present, reject truncated payloads and never guess from the family byte.
Compatibility and regression coverage
- Public method signatures and
HH:MM:SS:FFoutput remain unchanged, including for drop-frame rates. - Duration conversion remains distinct from absolute drop-frame position conversion.
- Existing creation/import template profiles are not broadened. This does not add a method for changing a session's frame rate.
- 655 tests pass locally with the private reference corpus, including 17 new tests, independent rational oracles, sequential drop-frame label checks and byte-identical no-op saves on 18 native references and three Pro Tools-resaved outputs.
- The three final API-generated outputs (48 ND, 119.88 DF and 120 DF) were validated by the maintainer in Pro Tools. Their native resaves preserve the expected placements, markers and audio, and each passes two byte-identical API save cycles. This does not claim exhaustive manual verification of every session variant at all 19 rates.
- A separate fixture-free local run passes 514 tests with 141 explicit skips. This is not a claim that the remote CI matrix has already run.
Related: issue #1, PR #2. The contribution is adapted locally rather than merged wholesale.
Draft publication checklist
This release must remain a draft until:
- The corrected code, with source and package versions already updated together to
1.6.1, is committed and pushed tomaster. - CI checks pass and the
v1.6.1tag points to the intended corrected commit, not an earlier1.6.0commit.
Pro Tools validation is complete. Remove this remaining publication checklist before publishing.