Skip to content

fix(live): the software live seek publishes its landing on the source axis (#107, #416) - #576

Merged
superuser404notfound merged 1 commit into
mainfrom
fix/sw-live-seek-source-axis
Sep 20, 2026
Merged

superuser404notfound merged 1 commit into
mainfrom
fix/sw-live-seek-source-axis

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

The live half of the axis confusion #573 and #575 fixed for VOD. Found by following the same question one path further.

What happens

clock.sourceTime rides the raw synchronizer clock on the software path, so that the overlay drainer's playhead and the packet store's timestamps agree. The $sourceClockSeconds sink in AetherEngine+Loading.swift says exactly that. The software live seek branch then writes the session-relative target over it, and states the pump's harvest anchor there too.

It does not wedge. The live branch returns from seek(to:) before seekInFlight is ever set, so the host's 250 ms tick puts the raw clock back on its own. Inside that window, though, one drain tick sees the whole offset as a step it cannot account for, so drainPlan reads it as an unannounced reposition, resets the cursor and scans a stretch the store has nothing at. The tick after it sees the same offset in the other direction and resets again. Two resets and a dark tick for a seek that moved the playhead a few seconds, on any source whose PTS do not start at zero, which is most MPEG-TS.

The change

SoftwarePlaybackHost.sourceSeconds(forSession:) covers both session shapes now: live anchors on sessionStartPts, VOD on the clockSessionZero the clock anchor resolved. The live branch publishes and anchors through it.

liveScrubStill and seekLiveDVR each held their own copy of that addition; both go through the accessor instead. Behaviour there is unchanged, deliberately, down to how a non-finite sessionStartPts is read. The mapping now exists once.

Test plan

  • swift test: 3164 swift-testing tests and the XCTest half green, exit 0.

The call site is not reachable from a unit test (the axis the host is on is private session state), so the guard is on the consequence instead: SubtitleOverlayDrainerTests pins that an axis change reads as a reposition twice and backscans below everything the store holds, while the carried value is the one reposition it really is.

Not device-verified. It needs a live SW session on a tuner whose PTS start well away from zero, and the visible effect is one tick of missing cues after a DVR rewind.

🤖 Generated with Claude Code

https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F

… axis (#107, #416)

`clock.sourceTime` rides the raw synchronizer clock on this path, so that the
overlay drainer's playhead and the packet store's timestamps agree; the
`$sourceClockSeconds` sink says so. The software live branch then wrote the
session-relative target over it, and stated the pump's harvest anchor there
too, which is the same confusion #575 fixed for VOD.

It does not wedge: the live branch never sets `seekInFlight`, so the host's
own tick puts the raw clock back within 250 ms. Inside that window one drain
tick reads the whole offset as an unannounced reposition, resets its cursor
and scans a stretch the store has nothing at, and the tick after it sees the
same offset in the other direction. Two resets and a dark tick for a seek that
moved the playhead a few seconds, on any source whose PTS do not start at zero.

`SoftwarePlaybackHost.sourceSeconds(forSession:)` now covers both session
shapes (live anchors on `sessionStartPts`, VOD on the resolved
`clockSessionZero`), and `liveScrubStill` and `seekLiveDVR` go through it
instead of each holding their own copy of the addition. Behaviour there is
unchanged; the mapping now exists once.

The call site itself is not reachable from a unit test, so the guard is on the
consequence: `SubtitleOverlayDrainerTests` pins that an axis change reads as a
reposition twice and backscans below everything the store holds, while the
carried value is the one reposition it really is.

swift test: 3164 swift-testing tests and the XCTest half green, exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F
@superuser404notfound
superuser404notfound merged commit 5767cf1 into main Sep 20, 2026
7 checks passed
@superuser404notfound
superuser404notfound deleted the fix/sw-live-seek-source-axis branch September 20, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant