Skip to content

fix(live): renew playlists when segment duration outgrows the seal - #748

Merged
superuser404notfound merged 1 commit into
superuser404notfound:mainfrom
yucelokan:fix/live-playlist-duration-renewal
Oct 13, 2026
Merged

superuser404notfound merged 1 commit into
superuser404notfound:mainfrom
yucelokan:fix/live-playlist-duration-renewal

Conversation

@yucelokan

@yucelokan yucelokan commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Renew the live playlist URL when a later GOP exceeds its sealed target duration, retaining the source and cached timeline. This avoids serving an invalid HLS playlist to AVPlayer while preserving the viewer's position and transport intent.

What changed

  • Keep the old video/subtitle playlist's target and end index fixed; expose retained segments through a new generation and reject future generations.
  • Preserve token, host/port and master/media route when renewing, including LAN URLs; relative media and subtitle resources retain their generation.
  • Replace only the native consumer item, clear stale outage state, cancel obsolete recovery tasks and avoid repeating the startup cushion wait.
  • Do not classify a media-duration violation as HDR/master rejection. Document the behavior and cover real HTTP playlist routing plus EXTINF rounding boundaries.

Test plan

  • Device / OS: Apple Silicon Mac, macOS 27.0.1; Xcode 27.0 / Swift 6.4. Prior PR revision: full swift test --jobs 4 --disable-automatic-resolution passed (764 XCTest cases, one skipped; 4,303 Swift Testing cases reported, with fixture-dependent skips). All 14 selected playlist/fallback cases passed with LIBDISPATCH_COOPERATIVE_POOL_STRICT=1; package build, doc links and whitespace checks passed.
  • Source media: generated MPEG-TS, H.264 Constrained Baseline 320×180 / 25 fps / yuv420p / SDR, AAC-LC mono 48 kHz. GOP starts at 0, 2, 4, 6, 8, 18, 28 and 38 seconds, deliberately changing from short to 10-second GOPs.
  • Real AVPlayer experiment on the integrated fork: fast live start and 120 s DVR; one playlist renewal and consumer-item replacement, retained source/cache, no sampled backward clock movement, no software fallback and no -12642. Playback buffered and resumed; this is not a claim of zero stalls. Regression tests also cover retired video/subtitle playlists, outage renewal, LAN URL preservation and serialized EXTINF rounding.
  • Physical-device integration, 12 October 2026: the app author ran fork 70e0a215 on a real Apple TV / tvOS 27.0 and iPhone / iOS 26.6.1. Both used MPEG-TS / H.264 High 1080p / AAC-LC stereo 48 kHz / SDR. No backward clock movement or player restart was recorded. Those channels did not exceed their sealed targets, so they verify ordinary live playback; the changing-GOP trigger is covered by the AVPlayer experiment and regressions above. Exact device models were not captured, and private provider URLs are omitted.

Current-main integration, 12 October 2026

Rebased this standalone PR onto upstream main 004eea20 (FFmpegBuild 3.7.1). Its complete macOS package/CLI/example build, documentation links and whitespace checks passed locally; the full-suite figures above describe the previous PR revision. Current-head CI supplies the full tests and platform matrix.

Additional integrated-fork device sessions used Apple TV / tvOS 27.0 and iPad / iOS 26.6.1 concurrently: private MPEG-TS channels, H.264 High Level 4.0 / 1920×1080 / 25 fps / SDR + AAC-LC stereo 48 kHz. Four repeated-source intervals were removed without sampled backward clocks, restarts or software fallback. Video-only gaps exposed an outgoing-PES interleaving edge case; that correction and its diagnostics are kept in #747. These are integrated device results, not isolated trigger coverage for every PR.

Current-head CI: 4cab379f passed all four checks: macOS full/strict-pool tests, iOS Simulator plus release CLI, tvOS/visionOS Simulator, and documentation links.

Checklist

  • CHANGELOG.md updated
  • Commit messages follow Conventional Commits (fix(...))
  • The fix lives in the engine, not in a host-side workaround
  • Public API changes are intentional and documented

Four-device integration follow-up (12 October 2026)

The integrated downstream build containing this PR was exercised on an iPhone/iOS 26.6.1, iPad/iPadOS 26.6.1, Apple TV/tvOS 27.0 and a Mac running the iPad-compatible app/macOS 27.0.1. The sanitized device, media and scenario report covers 8,246 current-build diagnostic records, 27 verified replay removals, live seeking and VOD/PiP use.

The remaining decoded-video boundary defects and recovery correction are in #747; this PR's code and standalone validation remain unchanged. These integration logs are not an isolated physical-device proof of this PR's specific failure path. No private source URLs, credentials or media are included.

Keep retired playlist targets and endpoints stable, retain source/cache and viewing intent across the item swap, and classify media duration violations separately from HDR rejection. Include HTTP, subtitle, outage and rounding regressions with architecture documentation.
@yucelokan
yucelokan force-pushed the fix/live-playlist-duration-renewal branch from 91d3ffe to 4cab379 Compare October 12, 2026 12:20
yucelokan added a commit to yucelokan/AetherEngine that referenced this pull request Oct 12, 2026
Integrate the published release and FFmpegBuild 3.7.1 while retaining the
independently offered probe diagnostics, callback-priority, live replay and
playlist-renewal contributions. Preserve upstream dependency ranges and
exclude unreleased main-only changes.

Keep the final cadence-aware outgoing-PES correction and scope native frame
diagnostics to APIs available on each platform, including visionOS.
All runtime source differences are covered by PRs superuser404notfound#745 through superuser404notfound#748.

Validation: 778 XCTest cases (one optional skip), 4,360 Swift Testing cases,
99 strict-pool regressions, and iOS/tvOS/visionOS library builds passed.
@superuser404notfound
superuser404notfound merged commit 74c81b3 into superuser404notfound:main Oct 13, 2026
4 checks passed
@superuser404notfound

Copy link
Copy Markdown
Owner

Merged as 74c81b3, thank you @yucelokan. The branch conflicted with #747 in four places; the merge keeps both sides: the reopen/exhaustion handlers and the renewal handler are registered next to each other, and reloadStalledConsumerItem now takes both preserveLivePosition (the #747 presentation repair, which still decides the rejoin when set) and replacementURL. The CHANGELOG line had landed under 7.35.0 and moved to Unreleased. Full suite on the merge with LIBDISPATCH_COOPERATIVE_POOL_STRICT=1: 764 XCTest cases (one skipped) and 4,418 Swift Testing cases passed, including all five renewal tests and the malformed-media fallback test. It ships with the next release.

yucelokan added a commit to yucelokan/AetherEngine that referenced this pull request Oct 13, 2026
Merge upstream main through the post-release superuser404notfound#748 integration, including maintainer follow-ups to superuser404notfound#708–superuser404notfound#717 and superuser404notfound#745–superuser404notfound#748. Runtime sources and tests match upstream; retain only fork provenance and GPL text. Full engine suite, strict-pool replay/recovery/origin tests and iOS/tvOS library builds passed.
Quick104 added a commit to timmyconnect/AetherEngine that referenced this pull request Oct 14, 2026
Takes upstream main through 74c81b3: 7.29.0 to 7.36.0 plus the
unreleased live-playlist renewal (superuser404notfound#748).

Retired fork changes, now covered upstream:
- TrueHD Atmos to APAC (d903760, 455bcd6, fa70ab5): upstream superuser404notfound#731
  adopted the fork's bridge, encoder, sample entry and renderer, with
  priming kept, and builds on it (encode pipeline, metadata hold, peak
  limiter, Atmos output activator, DTS:X). LibTrueHD moves from 2.0.0
  to upstream's 2.3.0 pin; LibDTSX 1.0.1 is new.
- TrueHD Atmos diagnostics (fork Silo-Server#17: 8ff23f8, 59d8406, 703f790,
  18729d1, d6cb090): BedLevelMeter, the route description and the
  1200-packet AE#641 report shipped in upstream 7.34.0 unchanged.
- Sidecar decode off the cooperative pool (241dff5): now upstream's
  BlockingWork.detached, still calling the fork's authorized
  decodeBlocking.
- The fork's CHANGELOG entries for the above.

Kept, and fitted onto upstream's code:
- Audio-switch tracking (5cda1c1, ba895a5, d6cb090):
  audioSwitchInFlight beside upstream's held-picture state, and
  pendingAudioSelection stays internal for BackgroundTeardownSelection.
- httpRequestAuthorization stays a known LoadOptions field beside
  upstream's three new ones.
- stopInternal cancels the remote-HLS preparation and stops the
  subtitle relay, and resets the scrub-preview generation.
- The superuser404notfound#694 park suite stays serialized and also runs off the
  cooperative pool.
- The TLS live suites keep the fork's structure; the accepted-read loop
  drops its wall-clock deadline as upstream's does.
- DocumentedConstants keeps the 8- and 10-channel APAC CODECS checks in
  upstream's combined test, and cli.md keeps the accurate apac.31.02 /
  31.03 / 31.04 levels.
- docs/api.md keeps the paused software-video seek sentence, and the
  objectAudioRendering row names `ObjectAudioRendering` again, which
  PublicAPIDocumentationTests requires (upstream main fails it).

New:
- HTTPAuthorizationWait and the remote-HLS timestamp-anchor probe start
  their tasks with BlockingWork.detached, which upstream's lint
  (BlockingWorkTests) now requires.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
neurekadev pushed a commit to neurekadev/silo-aether-engine that referenced this pull request Nov 3, 2026
Takes upstream main through fc6b412: 7.37.0, 7.38.0 and 7.38.1, plus the
LillyPlayer used-by entry (superuser404notfound#804).

Notable upstream changes for hosts:
- LoadOptions.preferDualLayerDolbyVision routes Profile 7 FEL to the
  dual-layer decoder (superuser404notfound#769, superuser404notfound#770), which applies the enhancement layer.
- objectAudioRendering covers DTS:X as well as TrueHD Atmos, and
  TrackInfo.isDTSX flags DTS:X tracks. LibTrueHD and LibDTSX sit behind
  the TrueHDObjectAudio and DTSXObjectAudio package traits, on by default.
  LibTrueHD moves to 2.3.1 and LibDTSX to 2.0.0 (LGPL).
- Live sessions can rotate request headers without a rebuild (superuser404notfound#792), and
  a refused credential mid-session is typed and heals on renewal.
- A software start holds the clock until its first frames are queued
  (superuser404notfound#800), and a software live join starts near the newest media (superuser404notfound#797).

Conflicts resolved:
- CHANGELOG: the fork's Unreleased entries stay under Unreleased; the
  live-playlist renewal entry (superuser404notfound#748) moves to upstream's 7.37.0 section.
- SessionOptionCorrection.knownFields keeps the fork's
  httpRequestAuthorization beside upstream's preferDualLayerDolbyVision.
- SoftwarePlaybackHost.play() takes upstream's stopped/failed guard first,
  then the fork's held end-of-media release (Silo-Server#15). seek() clears the
  fork's paused-frame gate and upstream's resident-range publication.
- DocumentedConstantsTests keeps both the fork's authorized-resource
  deadline check and upstream's 30 s positioning budget check.
- docs/api.md takes upstream's objectAudioRendering row, with its package
  trait note, and keeps the `ObjectAudioRendering` reference that
  PublicAPIDocumentationTests requires.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SmKM2DtjCuccTfuQwQo7DF
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.

2 participants