You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The shared reader indexes blocks in coding order. When Segment Duration was absent, EffectCraft used the end of the last indexed block, which can be earlier than the end of a reference picture. Take the maximum sample end for the selected track and keep the existing precedence for valid declared duration. RFC 9559, Duration and coding order · Cluster Blocks
matroska_duration_follows_presentation_order generates an H.264 Matroska clip with timestamp order 0, 80, 40 ms. The public probe returned 80 ms before the fix. It now returns 120 ms without the declaration, honors a distinct declared value when present, and the last presented picture decodes at 80 ms.
Verification
cargo test --locked -p effectcraft-media passed on Windows with 201 unit and 75 integration tests reported passing, plus one existing ignored test. FFmpeg-dependent cases skipped because FFmpeg was unavailable on PATH.
No actionable comments were generated in the recent review.
Walkthrough
matroska_duration now infers duration from the greatest presentation end across all samples. A Matroska regression test covers declared duration precedence and B-frame presentation ordering.
Changes: Matroska duration inference
Layer / File(s)
Summary
Duration inference and regression test crates/media/src/craft_source.rs
matroska_duration uses the greatest pts + duration across samples. The regression test checks declared duration precedence, inferred duration with H.264 B-frames, and retrieval of the final presented frame.
Matroska clips without a declared duration now report their full presentation length when pictures are stored out of display order. Declared durations keep their precedence. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "media: preserve Matroska presentation duration" matches the main change. The raw summary says matroska_duration now uses the maximum presentation end across samples instead of the last samp…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "media: preserve Matroska presentation duration" matches the main change. The raw summary says matroska_duration now uses the maximum presentation end across samples instead of the last sample in coding order, and the objectives say the PR takes the maximum sample end when no valid duration is declared. The title names the affected format and the affected value. It is specific and short, and it does not describe the code change in detail, which is acceptable.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
Clippy (1.99.1)
Clippy execution timed out
Clippy (1.99.1) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.
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.
Reviewing files that changed from the base of the PR and between 5f435d4 and 705a84d.
Files selected for processing: 1
crates/media/src/craft_source.rs
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
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
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.
Matroska clips without a declared duration keep their full presentation interval when pictures are stored out of display order.
Part of storytold/craft-libs#778 and storytold/craft-libs#781. Scoped claim
The shared reader indexes blocks in coding order. When Segment Duration was absent, EffectCraft used the end of the last indexed block, which can be earlier than the end of a reference picture. Take the maximum sample end for the selected track and keep the existing precedence for valid declared duration. RFC 9559, Duration and coding order · Cluster Blocks
matroska_duration_follows_presentation_ordergenerates an H.264 Matroska clip with timestamp order 0, 80, 40 ms. The public probe returned 80 ms before the fix. It now returns 120 ms without the declaration, honors a distinct declared value when present, and the last presented picture decodes at 80 ms.Verification
cargo test --locked -p effectcraft-mediapassed on Windows with 201 unit and 75 integration tests reported passing, plus one existing ignored test. FFmpeg-dependent cases skipped because FFmpeg was unavailable on PATH.git diff --check, andcargo clippy --locked -p effectcraft-media --all-targets -- -D warningspassed.Summary by CodeRabbit