Repository navigation
fix(remote-hls): sourceTime follows the presented frame on nativeRemoteHLS (AE#616) - #617
Merged
Merged
Conversation
… the injected renditions (AE#616) On the nativeRemoteHLS bypass sourceTime was AVPlayer's item time. An origin whose playlist places a segment at its slot while the segment starts at the keyframe before it (a Jellyfin transcode restarted with -noaccurate_seek -copyts) makes item time lead the picture, 1.1 to 8.3 s in the report. The #316 WebVTT renditions are placed by media timestamp, so each line reaches a legible output at cue start plus that lead. A non-suppressing legible output on the bypass item matches presented lines back to the cues the engine wrote and publishes sourceTime as item time less the measured lead. currentTime and seek(to:) stay on item time. Without an injected rendition selected nothing is measured and sourceTime stays item time, which the docs now say. Verified with aetherctl --picture-probe on a local fMP4 HLS whose playlist sits 1.5 s after its tfdt: capErr -1.46 s before the first line, one frame after it, and through a seek. 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.
Refs #616.
Problem
On the
nativeRemoteHLSbypassclock.sourceTimewashost.$renderedTime, i.e. AVPlayer's item time, while its docs promised the source PTS of the displayed frame. An origin whose playlist places a segment at its slot while the segment starts at the keyframe before it (Jellyfin restarts a transcode with-ss <slot> -noaccurate_seek -copyts) makes item time lead the picture. The reporter measured 1.1 to 8.3 s on device, so a host drawing libass fromsourceTimedrew every line early. The engine sees no segment on this route, so the lead can't be read where it arises.Fix
The #316 WebVTT renditions are placed by media timestamp, so each line reaches a legible output at
cue.start + lead. The engine wrote those cues, so it can match them back:RemoteHLSCueClock(pure): indexes the injected cues by normalized text. Each delivery with a newly appeared line measuresitemTime - cue.start. It skips the delivery at a time jump (a line active at the landing is stamped with the landing, not its start) and ignores lines ending. Repeated text resolves to a unique candidate first, then to the one nearest the current lead, inside a plausibility band of -2...30 s.RemoteHLSCueClockObserver: a legible output on the bypass item withsuppressesPlayerRendering = false. AVPlayer drawing is unchanged, a host's own suppressing output is unaffected, and the frozen-line trap from the report can't be triggered from here.timeJumpedNotificationre-arms the landing skip.sourceTime = max(0, itemTime - remoteHLSItemOffset)in the$renderedTimesink and at seek finalize.currentTime,seek(to:)and the scrubber stay on item time, so a seek round-trips. The offset is zero on every other path and is cleared at all three proxy teardown sites.PlaybackClock.sourceTime,LoadOptions.nativeRemoteHLS(also no longer claims to be live-only, since AE#154 reroutes VOD there) anddocs/api.md.Limit, stated in the docs: this only measures while an injected rendition is selected and presenting. Without one,
sourceTimeis item time. Between a seek and the next line it keeps the previous value.Verification
RemoteHLSCueClockTests: 9 cases.-strict-concurrency=complete: exit 0, XCTest 629 / 0 failures, swift-testing 3376 passed. tvOS and iOS generic builds pass.aetherctl play --native-hls --picture-probeon a local fMP4 HLS built fromScripts/timecode-fixture.sh, where a 1.5 s dummy slot puts every playlist slot 1.5 s after itstfdt(a second 2.7 s dummy at seg 30 for the seek arm):capErr -1.458(the lead,sourceTimeahead of the picture).AE#616: item time leads the presented frame by 1.500s):capErr +0.042, one frame at 24 fps, which is the probe's sampling phase.capErrstays within one frame. Side observation: AVPlayer kept its 1.500 anchor across that seek even though the segments there sit 4.2 s after theirtfdt, so on a local origin that does not restart, the seek did not re-anchor. The per-seek variation in the report therefore needs the real Jellyfin restart pattern, which this fixture does not reproduce. The re-measure path is covered by the unit tests.🤖 Generated with Claude Code
https://claude.ai/code/session_014AVNwe8YDG9EQM7uHdjT3f