You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Live edge cushion deeper than ~20 s never starts on tvOS: first manifest outlives AVPlayer's playlist timer (-16839) #851
Reported by a downstream app developer (Now Seen) on 7.45.0.
What happens
With LoadOptions.liveEdgeCushionSeconds = 30 a raw MPEG-TS live channel (Xtream, 1080p25 H.264, loopback route) never starts on tvOS:
The first-serve gate (VideoSegmentProvider.waitForFirstLiveSegment) holds the first /media.m3u8 response until the window carries max(3 x TD, cushion) of content. Its deadline is max(30, cushion + 15) s.
After the connect burst the source only fills at 1x, so the hold lasts roughly cushion - burst.
At about t+20 s AVPlayer gives up: CoreMediaErrorDomain -16839 "Unable to get playlist before long download timer", the item fails with NSURLErrorDomain -1008 / -12884. By then the producer had cut about 28.5 s.
Log lines: live startup policy: ... edgeCushion=30.000, asset.load(duration) failed: NSURLErrorDomain/-1008, errorLog code=-16839. Seen in the tvOS simulator. 10 s works.
On macOS (aetherctl live --preroll 0) a 31 s hold was served without AVPlayer giving up, which is why the 7.45.0 measurement did not catch it.
Why it matters
The cushion is currently paid entirely by withholding the first playlist response, so any cushion deeper than the burst plus AVPlayer's playlist timer cannot start on a strict-realtime origin. The plain .standard holdback (3 x TD, 18 s at TD 6) sits close to the same limit.
Direction
Keep the first manifest response under AVPlayer's playlist timer and pay the rest of the cushion some other way than a withheld response. Measure AVPlayer's actual timer and its behaviour with a HOLD-BACK deeper than the served window on tvOS before choosing.
Fixed on main in 98cd7cc (b77c837), not yet in a release.
Measured on tvOS 27 simulator with a plain AVPlayer against a loopback origin:
A held first media.m3u8 fails about 20.3 s after the request (NSURLErrorDomain -1008), with TARGETDURATION 2 and 6 alike. An 18 s hold still plays.
A HOLD-BACK deeper than the served window does not make AVPlayer wait: it starts at the window start at once, so the cushion would be lost.
Fix:loadNative waits out the same first-serve gate before host.load, so AVPlayer's playlist timer never runs during the wait. The playlist request is then answered at once and the served HOLD-BACK is unchanged.
aetherctl live --realtime --preroll 0 (strict-realtime origin, no burst):
arm
window ready
playlist request held
first playing
--live-cushion 30
31.1 s
0.000 s
+0.55 s after attach, ~29 s behind the source
.standard, no cushion
19.2 s
0.000 s
+0.36 s
--fast-zap
4.0 s (bounded start)
0.000 s
+0.18 s
The .standard row shows the default path held its first manifest within about a second of the tvOS timer before this change.
Tests: Issue851FirstLiveWindowBeforeAttachTests; full suite green (XCTest and Swift Testing, 4789 tests).
Activity
superuser404notfound commentedon Oct 22, 2026
Fixed on main in 98cd7cc (b77c837), not yet in a release.
Measured on tvOS 27 simulator with a plain AVPlayer against a loopback origin:
media.m3u8fails about 20.3 s after the request (NSURLErrorDomain -1008), with TARGETDURATION 2 and 6 alike. An 18 s hold still plays.HOLD-BACKdeeper than the served window does not make AVPlayer wait: it starts at the window start at once, so the cushion would be lost.Fix:
loadNativewaits out the same first-serve gate beforehost.load, so AVPlayer's playlist timer never runs during the wait. The playlist request is then answered at once and the servedHOLD-BACKis unchanged.aetherctl live --realtime --preroll 0(strict-realtime origin, no burst):playing--live-cushion 30.standard, no cushion--fast-zapThe
.standardrow shows the default path held its first manifest within about a second of the tvOS timer before this change.Tests:
Issue851FirstLiveWindowBeforeAttachTests; full suite green (XCTest and Swift Testing, 4789 tests).fix(live): build the first live window before AVPlayer is handed the …