-
Notifications
You must be signed in to change notification settings - Fork 11
feat(skip): free and skip boxes are now automatically skipped during parsing #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds handling for skip and free boxes during atom decoding. These boxes are now skipped with a debug log message, preventing errors when they are encountered.
Removes the `skip` field from the `Udta` struct and associated tests. The `skip` box is now automatically skipped during parsing.
WalkthroughAdds debug logging in the atom decoding path for Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (3)**/*.rs📄 CodeRabbit inference engine (CLAUDE.md)
Files:
src/**/*.rs📄 CodeRabbit inference engine (CLAUDE.md)
Files:
src/moov/**📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🔇 Additional comments (2)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/moov/udta/mod.rs (1)
18-18: Retain Skip export; document box-indexing limitationThe
Skiptype insrc/moov/udta/skip.rsis still referenced byAny::Skipinsrc/any.rs, so it must remain publicly exported. For issue #66, add a note in the crate-level docs (e.g. README orlib.rs), or open a follow-up issue to track that skipping boxes may affect the ordering when re-encoding.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
src/atom.rs(1 hunks)src/moov/udta/mod.rs(2 hunks)src/test/av1.rs(0 hunks)src/test/bbb.rs(0 hunks)src/test/esds.rs(1 hunks)src/test/h264.rs(1 hunks)src/test/hevc.rs(0 hunks)src/test/uncompressed.rs(0 hunks)
💤 Files with no reviewable changes (4)
- src/test/uncompressed.rs
- src/test/av1.rs
- src/test/hevc.rs
- src/test/bbb.rs
🧰 Additional context used
📓 Path-based instructions (4)
**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.rs: Code must be clippy-clean (cargo clippy --all-targets --all-features -- -D warnings)
Code must be formatted with rustfmt (cargo fmt) and pass formatting checks (cargo fmt -- --check)
Write unit tests inline within modules using #[cfg(test)]
Files:
src/atom.rssrc/moov/udta/mod.rssrc/test/esds.rssrc/test/h264.rs
src/**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
src/**/*.rs: Each MP4 atom type must implement the Atom trait with KIND, decode_body(), and encode_body()
Use Header::read_from() to handle large atoms without loading entire contents into memory
All operations should return Result using custom error types defined in error.rs
Use the custom Buf/BufMut traits for contiguous byte slices instead of ad-hoc buffer handling
Files:
src/atom.rssrc/moov/udta/mod.rssrc/test/esds.rssrc/test/h264.rs
src/moov/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place movie metadata atom implementations under src/moov/ (and its hierarchy: trak/mdia/minf/stbl/stsd)
Files:
src/moov/udta/mod.rs
src/test/**
📄 CodeRabbit inference engine (CLAUDE.md)
Put integration tests under src/test/ with sample MP4 files for different codecs
Files:
src/test/esds.rssrc/test/h264.rs
🧠 Learnings (1)
📚 Learning: 2025-08-31T04:06:57.364Z
Learnt from: CR
PR: kixelated/mp4-atom#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-31T04:06:57.364Z
Learning: Applies to src/any.rs : Register new atom types in the Any enum (src/any.rs) to enable flexible decoding
Applied to files:
src/atom.rs
🔇 Additional comments (4)
src/test/h264.rs (1)
383-383: LGTM! Test data updated to reflect Udta structural change.The Udta initialization correctly reflects the removal of the skip field from the struct. The change is consistent with the broader PR objective of automatically skipping free/skip boxes during parsing.
src/atom.rs (1)
198-199: LGTM! Skip and Free boxes now handled gracefully.The new match branches correctly implement the automatic skipping behavior requested in issue #66. The debug logging provides visibility into skipped boxes without cluttering normal output.
Minor note: The log messages ("skipping skip box" and "skipping free box") are slightly redundant but remain clear and unambiguous.
src/test/esds.rs (1)
300-300: LGTM! Test data correctly updated.The Udta initialization aligns with the structural change removing the skip field, consistent with other test updates in this PR.
src/moov/udta/mod.rs (1)
29-29: Test correctly updated to reflect structural change.The test initialization properly removes the skip field, consistent with the updated Udta structure.
Adds documentation to the `Free` and `Skip` structs, providing a brief explanation of their purpose and relationship to each other.
bradh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Sorry for the lag on getting this done.
closes #66
Option<Skip>fromUdtaand from related testsSummary by CodeRabbit
New Features
Refactor
Documentation
Tests