Repository navigation
fix(sw): HEVC packet coverage follows successors, and a full one forgets history (AE#613) - #614
Merged
Merged
Conversation
…ets history (AE#613) HEVC kept the strict pts + duration coverage, which tolerates no gap. A Matroska file muxed with 41 ms durations against 41/42 ms deltas at 23.976 fps left a one-tick hole at every 42 ms step: 0.70 islands a frame, so the frontier, bufferedPosition and the cached-seek eligibility all ended at the next rounding hole. HEVC now takes the successor-timestamp model H.264 already used. Its reorder bound is FFmpeg's own: hevc/ps.c rejects sps_max_num_reorder_pics above 15, inside the 32-timestamp queue. Coverage keeps its history behind the playhead for backward cached seeks, capped at 4096 ranges. A full coverage used to stop describing new packets (duration model, insert returned false and nobody read it) or invalidate itself (successor model), so every frontier after the cap was nil. It now forgets the ranges wholly behind the playhead first; a backward cached seek into forgotten history goes cold, which is correct. Measured on a 4K HEVC Matroska fixture over an HTTP origin, aetherctl --sw: buf 0.4 s ahead of the playhead before, 39.8 s after (the forward window). Tests fail without each half and pass with it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_014AVNwe8YDG9EQM7uHdjT3f
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.
Fixes the two coverage defects in #613, both found while answering #592.
SoftwarePlaybackHost.presentationReorderDepth(codecID:)), under FFmpeg's own bound:hevc/ps.crejectssps_max_num_reorder_picsabove 15, inside the 32-timestamp queue. Rounded container durations no longer split the coverage at every frame.Verification:
Issue613PacketCoverageTests: the codec test and both cap tests fail without the change and pass with it.swift testgreen (629 XCTest, 3367 swift-testing), plus the three standalone coverage/read-ahead scripts.aetherctl play --sw:buf0.4 s ahead of the playhead before, 39.8 s after, no starvation lines.Does not touch #592's turnover.
🤖 Generated with Claude Code
https://claude.ai/code/session_014AVNwe8YDG9EQM7uHdjT3f