Skip to content

Host control over clampLiveResumeIfBehindWindow: the in-play() snap preempts host resume policy, and its DVR clamp aims at the arithmetic lower bound #444

Description

@cmcpherson274

What should the engine do?

Let the host own the resume policy for a behind-live session: an option to disable
clampLiveResumeIfBehindWindow()'s automatic snap, which today runs inside play() and
silently moves the playhead (AetherEngine+Live.swift:50-65, unchanged 6.21.0 →
cb3baaf):

  • live-only (no DVR window): behindLiveSeconds > 45seekToLiveEdge();
  • DVR window: behind beyond the window → seek to seekableLiveRange.lowerBound + 5.

Two problems for a host with its own live-pause semantics:

  1. The snap preempts the host's resume policy. Ours decides at resume time whether a
    long-paused live session re-tunes fresh or stays parked behind live (a ≥90 s pause
    has its own product-defined path); the engine's silent seek inside play() makes
    that decision first and invisibly. A viewer who paused live TV for a minute and a
    half resumes somewhere they didn't choose.
  2. When the DVR-window clamp IS warranted, it aims at seekableLiveRange.lowerBound + 5
    — which is window arithmetic, not the cache's real floor (seekableLiveRange's lower bound is window arithmetic (max(0, edge − window)) — it never consults the cache, so the advertised rewind depth over-promises #441) —
    so the clamp target can be a position that was never retained.

The ask: a LoadOptions (or transport) flag — host-owned resume, no implicit seek in
play(); the engine reports (it already publishes behindLiveSeconds) and the host
decides. Default can stay exactly today's behavior. And when clamping remains enabled,
clamp against the real resident floor once one exists.

Motivating media or use case

Live TV with pause/rewind in a tvOS Jellyfin client (raw-TS via Jellyfin 10.11, native
loopback route, dvrWindowSeconds: 1800). The host carries measured, product-approved
pause semantics (latched long-pause re-tune vs in-place resume); the engine's in-play()
snap makes those unreachable on this rung. Measured sessions: stable −540 s behind-live
playback demonstrates the "deliberately far behind" state is real and healthy — a resume
there must not teleport.

Area

Public API surface

Host app / integration context

Custom tvOS Jellyfin client; behavior verified in source at 6.21.0 (87868c1) and 6.50.1
(cb3baaf); measurement harness aetherctl on macOS 26.5.2 / M4 Max.

Would you be willing to open a PR?

Maybe, with guidance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions