Repository navigation
fix(audio): the audio-only host parks its clock at end of media (#694) - #698
Merged
Merged
Conversation
AudioPlaybackHost reported end of media while its synchronizer kept rate 1, so currentTime grew past duration for as long as the session stood. AE#374 closed the same defect on the software host; this host never got it. The end-of-media callback now carries the generation and the last enqueued sample end. The park defers by the audio still queued (the playthrough wait releases up to 0.25 s early, and pausing the synchronizer stops the renderer too), then pauses the clock and publishes rate 0. play() treats the park like the software host does instead of restarting it as a stalled clock, and a seek clears it. Covered end to end by Issue694AudioHostEndOfMediaParkTests: a 1 s WAV decoded through the real host, clock rate 0 after the end and the position standing still within 10 ms over 0.5 s. Reported by ijuniorfu. 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.
Fixes the defect reported in #694.
AudioPlaybackHostreported end of media while its synchronizer kept rate 1, socurrentTimegrew pastdurationfor as long as the session stood. AE#374 closed the same defect onSoftwarePlaybackHost; the audio-only host never got it.Change
lastEnqueuedEnd; a stale callback after a seek is dropped.parkClockAtEndOfMediadefers by the audio still queued (SoftwareEndOfMediaClock.tailPlayoutSeconds, the playthrough wait releases up to 0.25 s early), then pauses the clock and publishesrate = 0. Parking at the demuxer EOF would cut that tail, as the report rightly says.play()passesparkedAtEndOfMediaintoRendererClockResume, so a play press after the end no longer restarts the clock as a stalled one (AE#549 path). A seek clears the latch.The park uses
pause()after the tail has played out rather thanseekClock(to: lastEnqueuedEnd, rate: 0): the clock is on the last sample by then either way, and this keeps both hosts on one implementation.Verification
Issue694AudioHostEndOfMediaParkTests: a 1 s WAV through the real host. Fails onmain(clock rate 1.0 after the end), passes here: rate 0, position within 10 ms over 0.5 s, at 1.0 s +- 0.1.swift test: XCTest 17/17, swift-testing 4060 tests with one failure,SubtitleOCRTests"Vision recognizes clean synthetic subtitle text" hitting its 180 s time limit, unrelated to this change (checked againstmain).🤖 Generated with Claude Code
https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS