Skip to content

Expose duration_is_empty and default_base_is_moof flags on Tfhd#151

Open
alexkirsz wants to merge 1 commit intokixelated:mainfrom
alexkirsz:alexk/default-base-is-moof
Open

Expose duration_is_empty and default_base_is_moof flags on Tfhd#151
alexkirsz wants to merge 1 commit intokixelated:mainfrom
alexkirsz:alexk/default-base-is-moof

Conversation

@alexkirsz
Copy link
Copy Markdown

These boolean flags were defined in the ext! macro but silently discarded during decoding and defaulted to false during encoding, making it impossible to set default_base_is_moof without manually patching encoded bytes.

Closes #148

These boolean flags were defined in the ext! macro but silently
discarded during decoding and defaulted to false during encoding,
making it impossible to set default_base_is_moof without manually
patching encoded bytes.

Closes kixelated#148

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2aeb69c1-59f4-4c9d-852e-6ce8f29e1c5a

📥 Commits

Reviewing files that changed from the base of the PR and between 8481ed9 and 7139232.

📒 Files selected for processing (5)
  • src/moof/traf/tfhd.rs
  • src/test/av1.rs
  • src/test/bbb.rs
  • src/test/esds.rs
  • src/test/h264.rs

Walkthrough

This pull request adds two new boolean fields (duration_is_empty and default_base_is_moof) to the Tfhd struct in src/moof/traf/tfhd.rs. The decoding logic was updated to populate these fields from the TfhdExt structure, and the encoding logic was updated to write these fields back to TfhdExt. Unit tests were extended with new test cases for round-trip encoding/decoding scenarios. Test expectations across multiple files (av1.rs, bbb.rs, esds.rs, and h264.rs) were updated to include assertions for these new fields in the decoded Tfhd structures.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: exposing two boolean flags (duration_is_empty and default_base_is_moof) on the Tfhd struct, which directly addresses the primary objective of making these flags accessible.
Description check ✅ Passed The description explains the issue (flags were silently discarded and defaulted to false), the solution (expose the flags), and the related issue (#148), which is directly related to the changeset.
Linked Issues check ✅ Passed The PR fully addresses issue #148 by exposing the duration_is_empty and default_base_is_moof flags on the Tfhd struct, allowing them to be set during encoding without manual byte patching.
Out of Scope Changes check ✅ Passed All changes are directly scoped to exposing the two boolean flags: adding fields to Tfhd struct, updating decoding/encoding logic, and updating test expectations. No unrelated changes are present.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tfhd: no way to set default_base_is_moof flag when encoding

1 participant