Skip to content

5.23.7

Choose a tag to compare

@superuser404notfound superuser404notfound released this 26 Jul 13:02

Patch release. One fix to the reported buffer frontier, a follow-up to the anchor shipped in 5.23.4.

Fixed

A seek no longer makes the reported buffer frontier claim a lead the size of the seek distance.

For a tick or two after a far seek, clock.bufferedPosition reported the band at the seek destination as if it sat ahead of the position the seek had left, so a host drawing a buffer bar from it saw a lead of tens of minutes over a playhead with nothing resident ahead of it. It corrected as soon as the clock landed.

The frontier walk anchors at max(playhead, consumer fetch target), which is sound because a segment is only ever declared as the target from the segment-serve path, so everything below it has been handed to the consumer and sits in its own buffer. That reasoning holds inside an uninterrupted fetch sequence: AVPlayer fetches no further ahead than its own buffer reaches, and that is what keeps the distance between the playhead and the target bounded during normal playback (around 120 s). A seek removes the bound, and because the consumer needs the data in order to seek, its fetch at the destination lands before currentTime() reports the new position. The walk therefore ran through the freshly produced band at the destination and measured it against the playhead the seek had jumped away from.

The cache now tracks the consumer's current fetch sequence, and outside it the walk anchors on the playhead, reporting the band genuinely reachable from there or nothing when the playhead's own segment has been evicted. A backward refetch of the Continuous-Audio handover, and the return to the fetch front that follows it, stay inside the sequence, so the opt-in whole-source prefetch case the anchor was introduced for is unaffected.

What remains is bounded by the backward window instead of by the seek distance: a scrub shorter than that window stays inside the sequence and can still anchor on the previous target for a tick.

Playback was never affected. Only the published figure was wrong.

Verification

1100 tests green, swift build -Xswiftc -strict-concurrency=complete clean, CI green on macOS, tvOS Simulator and iOS Simulator.

Acknowledgements

Reported with device logs and analysis by @fxndxs, who also confirmed the 5.23.4 anchor on device in the same session. Credited as co-author on the fix.