Repository navigation
Conversation
Track actual playhead movement instead of treating whole-segment decode lead as a backward seek. Preserve the default newest-64 queue and expose opt-in non-dropping delivery for continuous PCM analysis. Closes superuser404notfound#864 Related to superuser404notfound#863
qoli
marked this pull request as ready for review
October 25, 2026 18:25
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.
Summary
Closes #864.
A whole audio-tap segment can legitimately decode beyond the preferred lead. Treating that lead as a backward seek makes loopback and remote-HLS VOD readers repeatedly decode the same segments, breaking continuous PCM analysis. Track actual playhead movement and wait when a complete segment merely runs ahead.
Add
installAudioTap(lossless: Bool = false)so continuous-analysis consumers can retain queued PCM without eviction while existing no-argument calls keep the newest-64 policy.Relation to #863
This is the standalone downstream implementation described in #864, submitted against main as an alternative to #863. Both address long-segment re-decoding. #863 infers a backward seek from the previous segment's start and raises the default bounded queue to 256. This change observes the previous playhead directly, preserves the existing default queue, and provides opt-in non-dropping delivery.
What changed
Test plan
Apple Silicon Mac14,14, macOS 27.0.1 (26A434), Xcode 27.1 (27A9275), Swift 6.4. Based on upstream
370b0e4dcc6fb49fca1b6999b075616d3442cb04. All five production files match the existing downstream 0009 implementation; the submission strengthens the burst regression and adds upstream documentation.swift build: passed.LIBDISPATCH_COOPERATIVE_POOL_STRICT=1focused audio-tap checks: 30 XCTest cases passed.python3 Scripts/check-doc-links.pyand diff whitespace checks: passed.Issue220SoftwareDecoderDrainTests.decodesFixtureFrames:counter.value >= packets - 16failed.HLSLocalServerSlowPeerTests.lanPeersLeaveLoopbackSlots: exceeded its existing 120-second time limit.The two failing tests and their production implementations are outside this diff. Their cause is not established by this run, so this PR remains a draft rather than claiming a green full suite.
The focused regressions use synthetic segments/PCM and injected loopback/remote-HLS VOD dependencies. Dependency versions and commit SHAs match upstream's checked-in
Package.resolved; official local Git mirrors avoided repeated downloads. The historical physical tvOS 26.6 observations are recorded in #864; this submission does not claim a new device playback run. Platform/all-traits coverage remains for upstream CI.Checklist
CHANGELOG.mdupdated