Repository navigation
Conversation
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.
Positive-duration audio packets can describe a continuous sample clock while their timestamps are quantized to a coarse container time base. For example, non-reservoir WMA frames of 2,048 samples at 44.1 kHz occupy 46/47 ms steps; treating each declared 46 ms packet independently fragments cache coverage and rejects seeks into bytes already retained.
Carry a feasible integer rational sample-clock phase across packets when the codec parameters admit exact sample geometry. Use the same coverage for the read-ahead frontier, resident ranges and retained-seek admission. A genuine missing packet, accumulated drift, missing/backward timestamps, conflicting duration or arithmetic overflow cannot be explained away by a fixed gap tolerance. Unknown codecs/packed layouts keep strict coverage. The decoded audio output clock and video admission are unchanged.
Admission covers AC-3/MPEG audio, declared AAC/E-AC-3 frame sizes, complete non-reservoir WMA v1/v2 blocks and exact PCM sample frames. This reuses upstream's duration-less successor coverage (#775) rather than presenting it as a new TrueHD fix. It overlaps #823's overflow protection in the replaced audio coverage helper: this model also checks subtraction overflow. If #823 is accepted first, preserve its regression when resolving that textual overlap. #613/#614's video interval behavior is unchanged.
Tests include 24 long sample-rate/time-base combinations, exact PCM/WMA admission, drift/real gaps/unknown layouts and actual disk and memory stores. The memory integration witnesses keep packets in the non-purgeable forward queue; they do not assume consumed history survives reclamation (#759/#819).
Validation on Apple Silicon (Mac17,3), macOS 26.7.1 / Swift 6.4:
swift build --build-testspassed; test executable signed and verified with a valid Apple Development identity.git diff --checkpassed.CI on the initial implementation passed iOS/tvOS/visionOS builds and default/all-traits tests, including both strict cooperative-pool runs. Its later standalone regression step exposed a missing source entry in
test-software-packet-read-ahead.sh; the follow-up commit addsSoftwareAudioPacketCoverage.swiftto that build. All six standalone packet regressions now pass locally (packet/video coverage, disk FIFO, read-ahead, read admission and stored packets), with Apple Development signatures verified. CI for the follow-up commit is pending. These are deterministic timing and store witnesses, not new physical media/device acceptance.