Repository navigation
fix(io): the VOD packet cache covers audio packets that carry no duration - #775
Merged
superuser404notfound merged 1 commit intoOct 15, 2026
Conversation
…tion Matroska TrueHD reaches the software read-ahead with no packet duration and millisecond timestamps that repeat (0.83 ms frames on a 1/1000 time base). SoftwarePacketCoverage.insert rejects a zero duration, so audio coverage stayed empty, the combined A/V frontier was nil, and no seek ever hit the packet cache: every seek, even back to a spot just played, refetched from the source. Audio arrives in presentation order, so a duration-less packet now proves coverage up to the next packet's timestamp, as long as the gap is at most 0.5 s (a larger one is a hole). Packets with a duration are unchanged. Apple TV 4K, 4K Matroska with TrueHD 7.1 over HTTP, 5 seeks per run: cache hits went from 0/10 to 5/5 in every run; AC-3 and video-only already hit 10/10. The new test fails without the change.
This was referenced Oct 13, 2026
Merged
Merged
Merged
Merged
Owner
|
Merged as 9480b14, thanks. The earlier close was a slip during the #765 merge, not a rejection. Only conflict was CHANGELOG (kept both entries). Checked locally: the new suite passes, the TrueHD test fails against the pre-change |
superuser404notfound
pushed a commit
that referenced
this pull request
Oct 21, 2026
…me size is wrong, changelog for #828 The sample-clock model skipped the duration-less fallback whenever codec geometry was admitted. A declared frame size that understates the packet (implicit HE-AAC: codecpar 1024, packets 2048) fails the join on every packet, so a duration-less track covered nothing and every seek refetched, the regression #775 fixed for TrueHD. The fallback now applies whenever the join fails. Also keeps #823's overflowing successor case as a regression. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
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.
Standalone. Base:
main. Independent of the FEL stack.Summary
Matroska TrueHD reaches the software read-ahead with no packet duration and millisecond timestamps that repeat (0.83 ms frames on a 1/1000 time base).
SoftwarePacketCoverage.insertrejects a zero duration, so audio coverage stayed empty, the combined A/V frontier was nil, and no seek ever hit the packet cache: every seek, even back to a spot just played, refetched from the source and the queue ran dry for seconds.Audio arrives in presentation order, so a duration-less packet now proves coverage up to the next packet's timestamp, as long as the gap is at most 0.5 s (a larger one is a hole). Packets with a duration are unchanged.
Measurements
Apple TV 4K, a 4K Matroska title with TrueHD 7.1 served over HTTP, 5 seeks per run: cache hits went from 0 of 10 to 5 of 5 in every run. AC-3 and video-only versions of the same file already hit 10 of 10.
How it was tested
SoftwarePacketReadAheadAudioCoverageTests: duration-less repeating-millisecond audio makes a retained seek a cache hit; a gap over 0.5 s is not bridged; audio with durations is unchanged. The first test fails without the change.Scripts/test-software-packet-read-ahead.shand the read-ahead suites pass. Full suite (onmainwith this PR, RA2 and the FEL stack merged): 4786 tests in 648 suites plus 17 XCTest pass underswift test; underLIBDISPATCH_COOPERATIVE_POOL_STRICT=1 swift test --skip-build --disable-xctestall pass except one run ofItemSwapStillTests(its fixture writer failed under load; 3 of 3 reruns pass, and the stack does not touch it).