Source: https://developer.apple.com/forums/thread/802032 (report created September 2025; checked 2026-11-11).
Observed vs inferred#
Reporter builds HLS playlists from fragmented MPEG-TS and observes approximately 2–3 seconds of audio/video desynchronization after seeking and resuming on iOS/iPadOS/macOS 26. Reporter states older OS versions did not show this and pause-before-seek was ineffective. No reply or verified fix is present in the source. Root cause unverified.
Public API contract#
Apple documents that AVPlayer.seek(to:toleranceBefore:toleranceAfter:completionHandler:) may land within the requested tolerance interval; zero tolerances request sample-accurate seeking but may increase decoding delay. A prior pending seek can finish with finished=false if interrupted by a newer request. Neither behavior alone explains a sustained 2–3 second A/V offset.
Source: https://developer.apple.com/documentation/avfoundation/avplayer/seek(to:toleranceBefore:toleranceAfter:completionHandler:)
Causal map#
TS input → segmenter → HLS playlist → segment HTTP delivery → TS demux/PCR/PTS/DTS → seek target/keyframe alignment → audio/video decode → presentation clock.
The first observed symptom is post-seek presentation divergence. The first causal divergence is not yet known.
Competing hypotheses (NOT verified)#
- Packaging timeline mismatch: discontinuous or offset PCR/PTS/DTS across adjacent TS segments, exposed by seek. Falsify with byte-level timestamp inspection and independently generated reference media.
- Seek alignment/ordering: seek tolerances, multiple overlapping seek operations, or keyframe alignment create unexpected effective seek positions. Falsify by logging request, completion flag, actual time, and using zero tolerances.
- Platform regression: same byte-identical input and operations behave differently on OS versions. Falsify with repeated cross-version physical-device A/B trials; cross-version differences alone do not prove an AVFoundation bug.
- Network/cache inconsistency: mismatched playlist and segment generations after seek. Falsify with response-body hashes and ordered request traces.
- DRM-specific transition: only relevant if authorized FairPlay assets differ from clear control. No DRM-specific evidence in original report.
Prioritized experiment#
Build a test asset with visible burned-in frame timecode and synchronized audible impulses. Preserve SHA-256 hashes of manifests/segments. Run seek-to-10s, seek-to-segment-boundary, seek-to-mid-segment, repeated seeks, and precise vs default tolerances.
Record actual audio output and video display with a common capture clock; do not treat player.currentTime() alone as proof of A/V sync. For each test log monotonic request/completion timestamps, finished, currentTime, timeControlStatus, access/error logs, and decoded sample PTS where available.
Run identical bytes on affected and comparison OS versions. Quantify median, p95 and worst absolute A/V offset and reproducibility.
Client-only mitigation candidates (validate, not guaranteed)#
Serialize seeks and ignore stale completions using a seek generation identifier; test explicit zero-tolerance seeking when accuracy matters; defer UI playback-state transitions until the latest seek completes. Do not claim these repair a packaging timestamp defect.
Separate packaging/server proposals#
If TS continuity faults are verified, propose correcting PCR/PTS/DTS, discontinuity signaling, keyframe/segment alignment or remuxing to compliant fMP4. These are not client-only changes.
Publication status#
Evidence-backed investigation plan; no device reproduction, captured media bytes, or symbolicated AVFoundation trace. ROOT CAUSE UNVERIFIED.
Extended investigation prompt#
Show the full second-AI investigation prompt
Act as a senior iOS/tvOS reverse engineer, AVFoundation/CoreMedia investigator, MPEG-TS/HLS timing specialist, and FairPlay DRM security expert.
CASE: https://developer.apple.com/forums/thread/802032
Reported: iOS/iPadOS/macOS 26 AVPlayer HLS generated from TS files shows 2–3 seconds of A/V desynchronization after seeking and resuming. Earlier OS reportedly unaffected; pause-before-seek did not help. Root cause UNKNOWN.
GOAL: identify the FIRST PROVEN causal divergence, not simply the observed A/V offset.
STRICT EVIDENCE HIERARCHY:
1. Apple Developer Documentation, Apple HLS Authoring Specification, official Apple engineer statements, relevant RFC/ISO MPEG-TS/HLS standards, FairPlay SDK.
2. Version-pinned verified WebKit/Apple open-source code, symbolicated AVFoundation/CoreMedia traces, CFNetwork/sysdiagnose, peer-reviewed or independently verified security research. WebKit is NOT AVPlayer implementation evidence.
3. Byte-preserved manifests/segments, ffprobe or transport-stream forensic output, physical-device A/B traces, authorized KSM metadata, reproducible controlled tests.
4. Hypotheses clearly labeled and falsifiable.
For each code claim cite URL, commit SHA, file, function and exact lines. For each conclusion provide observation, evidence tier, counterevidence, confidence and falsification test. Never invent sources or measurements.
INVESTIGATE:
- Manifest: EXTINF, MEDIA-SEQUENCE, DISCONTINUITY, DISCONTINUITY-SEQUENCE, MAP, PROGRAM-DATE-TIME, variant/audio renditions, TARGETDURATION.
- MPEG-TS: PAT/PMT, PIDs, continuity counters, PCR/PTS/DTS, 33-bit wrap, B-frame reorder, keyframes, audio sample duration, timestamp reset, gaps and overlaps across segment boundaries.
- Playback: requested seek time/tolerances, completion finished flag, actual currentTime, playback rate, item status, timeControlStatus, access/error logs, timed metadata, seekable ranges; compare audio and video presentation timelines with a timecode/impulse test asset.
- Network: exact playlist and segment bytes, final URLs, redirects, byte ranges, cache consistency, response timings.
- DRM only if encrypted assets reproduce differently: trace EXT-X-KEY → SKD/key identifier → AVContentKeySession → SPC/KSM/CKC → key acceptance → protected decoding. Use authorized assets; never expose secrets or bypass DRM.
CONTROLLED TESTS:
same byte-identical asset on affected and unaffected OS; seek at segment boundaries vs mid-segment; precise zero-tolerance vs default seek; seek while paused vs playing; single vs repeated seeks; TS vs independently remuxed fMP4; clear vs authorized FairPlay. Change one variable at a time, run repeated trials, log monotonic timelines and hash media bytes. Do not presume remuxing is a client-only fix: label packaging/origin changes separately as PROPOSALS.
ROOT CAUSE may be declared only if the failure reproduces, first divergence is demonstrated, an intervention reverses it, and alternatives are tested. Otherwise state ROOT CAUSE UNVERIFIED.
OUTPUT: executive finding; evidence ledger; timing diagrams; manifest/TS audit; first proven divergence; OS comparison; competing hypotheses; test matrix; client-only mitigation; separately labeled packaging proposals; regression tests; unknowns; exact source URLs; publication-ready article.