LL-HLS live playlist refresh drops updated partial references — Shaka stall after ~10s

GitHub source

Reproduced. This page is generated from GitHub Issue #45; GitHub remains the canonical authoring and discussion source.

Local reproduction and solution — 18 November 2026#

Status: Actual live-parser partial-reference regression reproduced and fixed.

Source and evidence#

Upstream case · local report and evidence · portable reproduction instructions

Observed results are Reproduced only within the stated seam. Implementation explanations remain Inferred, not Apple Confirmed.

Reconstruct the scene#

Refresh a live HLS playlist whose known media-sequence segment gains additional EXT-X-PART entries, growing its partial list from two entries to four.

The actual upstream HlsParser fixture fails with the parent production file and passes with commit 2e13ea2c4192d89c5523eb942bc9de1f575c12fd. No replacement parser model is used.

Solution / guideline#

Use/backport PR #10154: merge rebuilt live references even when their media-sequence position is already known, using isNewSegment || !isNewStream before mergeAndEvict.

All pinned patches and results

Limits / remaining work#

Real parser refresh/index path with controlled playlist responses, not prolonged live playback or native AVPlayer verification.

This update supersedes earlier no-local-run statements below only within the stated scope. Historical source reports are retained; no unresolved issue is closed by this publication.


Earlier investigation and source history

Verification update — 17 November 2026#

Status: reproducible upstream regression; fix merged. PR #10154 merged on 2026-05-29 as 2e13ea2c4192d89c5523eb942bc9de1f575c12fd.

  • Reproduction: an LL-HLS live segment gains additional EXT-X-PART entries across playlist refreshes, but the segment index retains its earlier partial list; playback consumes those parts and stalls after roughly 8–12 seconds.
  • Solution: pass rebuilt live references to mergeAndEvict even when the media-sequence position is already known: isNewSegment || !isNewStream. The patch changes hls_parser.js and adds coverage in test/hls/hls_live_unit.js; the author of the original optimization confirmed the missing handling of partial segments.
  • Action: use a build containing #10154 or backport the patch with its LL-HLS regression test.
  • Scope: upstream report, source fix and test addition verified; no local playback trial or native AVPlayer experiment was run here. A source-level fix does not establish a native Apple-player defect.

This update supersedes older statements below about missing fix verification; the historical investigation and prompt are retained.


Case: LL-HLS freezes after ~10 seconds because refreshed partials never reach the segment index#

Source: shaka-project/shaka-player#10149 (reported May 28, 2026). Upstream fix: shaka-project/shaka-player#10154 (merged May 29, 2026; fix commit 3d19259, merge commit 2e13ea2).

Reported behavior and evidence#

The reporter observed an LL-HLS stream freeze after roughly 8–12 seconds without a playback error; the issue states v5.0.11 worked while v5.0.12 regressed. The original report also lists 5.1.6 as the tested version, so do not conflate the version fields. The report names optimization commit fe85012 / PR #9998.

In createSegments_(), mediaSequenceToStartTime tracks previously encountered segment positions. A live LL-HLS segment is mutable during playlist refreshes: new EXT-X-PART entries accumulate before the segment is finalized. The optimization appended a rebuilt reference to newReferences only when isNewSegment was true.

Thus, an existing segment with additional parts was rebuilt but discarded before mergeAndEvict(), leaving the segment index with a stale partial list. Once available parts were consumed, playback stalled.

Upstream's one-line correction changes:

- if (isNewSegment) {
+ if (isNewSegment || !isNewStream) {
    newReferences.push(reference);
  }

During live updates, rebuilt references are passed through; the earlier short-circuit still avoids rebuilding unchanged segments. This is verified upstream source-level root-cause analysis and merged fix, not an independently executed playback experiment.

First divergent transition#

playlist reload → EXT-X-PART list grows → createSegments_ rebuilds reference → isNewSegment=false → reference discarded → mergeAndEvict receives no updated reference → stale SegmentIndex → no next part scheduled → stall.

Key insight: A stable media-sequence number is not a stable segment value. Treat LL-HLS partial-reference updates as updates to an existing entity, not only insertion of a new entity.

Evidence hierarchy#

  1. Normative contracts: Apple HLS documentation and the LL-HLS playlist semantics in the current HLS draft; establish what EXT-X-PART, EXT-X-SERVER-CONTROL, CAN-BLOCK-RELOAD, PART-HOLD-BACK, and EXTINF mean.
  2. Verified implementation: Shaka issue #10149, PR #10154, pinned source and commit diff. WebKit is not native AVPlayer source.
  3. Controlled reproduction: byte-identical playlist snapshots and parts; compare affected and fixed Shaka builds; verify SegmentIndex and requested part URIs.
  4. Hypotheses: only where evidence is missing.

Reproduction plan#

Create a deterministic LL-HLS playlist server that publishes segment S with 2, then 4, then 6 parts while keeping the same media sequence; subsequently publish EXTINF for S. Capture each playlist response and part response with monotonic timestamps.

Compare affected and fixed builds, logging mediaSequenceToStartTime, firstReferenceToCreate, isNewSegment, isNewStream, newReferences, and SegmentIndex part count. Run 10+ repetitions per build; track stall rate, last downloaded part, buffering state, and playback progress.

Keep network timing and media bytes identical. Add a finalized-segment and non-LL-HLS control.

Native AVPlayer applicability#

The upstream bug is in Shaka's JavaScript manifest/segment-index management, not evidence of an AVFoundation defect. For AVPlayer, compare only externally observable playlist requests, part requests, playback states, and AVPlayerItem access/error logs. Do not infer private AVPlayer index implementation.

FairPlay applicability#

The original case is not a FairPlay report. Only investigate EXT-X-KEY → SKD/KID → AVContentKeySession → SPC → KSM → CKC if encrypted assets independently reproduce a divergent symptom. Do not confuse segment scheduling with key acquisition.

Client-only action#

For a Shaka-based client, use a release containing upstream PR #10154 or backport the verified fix with regression tests. For native AVPlayer, instrument part request progression and error logs; do not apply a Shaka-specific patch. CDN/packager changes are separate proposals, not assumed requirements.

Extended investigation prompt#

Show the full second-AI investigation prompt
Act as a senior iOS/tvOS reverse engineer, AVFoundation/CoreMedia and LL-HLS forensic engineer, and FairPlay DRM specialist.

CASE: https://github.com/shaka-project/shaka-player/issues/10149
FIX: https://github.com/shaka-project/shaka-player/pull/10154

OBJECTIVE: independently verify the first causal divergence that makes LL-HLS stall after ~10 seconds, then determine whether the failure is confined to Shaka or reproducible with native AVPlayer. Never invent evidence.

STRICT EVIDENCE HIERARCHY:
Tier 1: official Apple Developer Documentation, HLS Authoring Specification, FairPlay Streaming Server SDK, WWDC/Apple engineer statements, applicable IETF/ISO specifications.
Tier 2: pinned Shaka and verified WebKit source, Apple open-source code, symbolicated AVFoundation/CoreMedia/CFNetwork traces, peer-reviewed or independently verified security research. Every source claim requires URL, commit SHA, file, function, line range and control-flow explanation. WebKit does not prove native AVPlayer internals.
Tier 3: byte-verified manifests, HTTP captures, physical-device experiments, reproducible before/after tests.
Tier 4: explicitly labeled hypotheses with falsification tests.

INVESTIGATE: EXT-X-PART, PART-INF, SERVER-CONTROL, blocking reload, EXTINF, media sequence; trace playlist refresh → createSegments_ → mediaSequenceToStartTime → firstReferenceToCreate → newReferences → mergeAndEvict → SegmentIndex → next part request → buffer admission. Inspect regression commit fe85012 and fix PR #10154; verify actual commit hashes and line numbers. Determine whether rebuilt existing segments are incorrectly discarded.

EXPERIMENTS: use deterministic snapshots with 2→4→6 parts for one media-sequence number; compare affected and fixed Shaka builds and finalized-segment control; log index part counts, HTTP requests, buffer state and stalls. Repeat 10+ trials, one variable at a time. Compare native AVPlayer separately using identical media and AVPlayerItem access/error logs. Never infer AVFoundation implementation from Shaka.

FAIRPLAY: only if protected media independently differs, trace EXT-X-KEY/SKD, AVContentKeySession, SPC/KSM/CKC and key acceptance with authorized assets. Never disclose keys, SPC/CKC bytes, credentials or bypass DRM.

REPORT: executive finding, evidence ledger, normative contract, pinned source diff, first proven divergence, failing/success timelines, controlled experiment results, competing hypotheses, root cause confidence, client-only mitigation, separate server proposals, regression tests, exact source URLs, and publication-ready article. Distinguish upstream-verified fix from experiments you personally ran.

Verification status: upstream issue and merged PR inspected; no local playback reproduction or AVPlayer device experiment performed.