Repository navigation
fix(live): fastZap ingest joins the cushion it seals, and the ingest honours the request budget (AE#678) - #679
Merged
Conversation
…st honours the origin request budget (AE#678) The served TARGETDURATION on an ingest is floored by the longest upstream segment (ceil(longest / 1.5), AE#447), so a 10 s provider seals TD 7 and the first serve wants 21 s. The join covered max(8, 1.5 x advertised TD), two 10 s segments, 19 s cut once the last GOP stays open: short by construction for every segment above ~5 s, so every fastZap zap ended at the bounded start's grace. The join now covers that holdback plus one GOP (bounded at 4 s). HLSLiveIngestReader charged nothing to OriginRequestBudget and fetched four segments in parallel, so maxConcurrentSourceRequests = 1 meant four connections to a single-connection provider. Every playlist, segment and key fetch now takes a ticket, notes refusals and redirects, and the prefetch window narrows to the origin's limit. A direct .custom ingest load registers the declared ceiling on the playlist URL. Measured, hlsfixture 10 s segments / 1 s GOP behind a proxy (50 ms, 40 Mbit/s shared), play --live --fast-zap, 3 runs per arm: - loopback: first picture t+2.24..2.52 s -> t+0.22 s, full cushion instead of bounded start - 40 Mbit/s: t+4.11..4.39 s -> t+2.87..2.90 s - single-connection proxy, --max-concurrent-requests 1: peak inflight 2 and two 429 per zap -> peak inflight 1, no refusal Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
… host are written again, and every open states its timings (AE#678) - A live URL with a .m3u8/.m3u path, or one that already took the AE#363 route in this process, goes straight onto the ingest instead of spending a discarded raw request per zap. - DisplayCriteriaController reads preferredDisplayCriteria back before the unchanged skip, so a host that cleared it itself (leaving full screen) gets its frame rate on the next same-format load instead of the UI mode. - [Demuxer] open timings: connect / open_input / find_stream_info / total, stream count and probe budget, also when the stream analysis fails. - LoadOptions.probesize no longer claims an over-tight budget always fails open. Measured against a proxy that answers a second concurrent request with 403 (--max-concurrent-requests 1, 10 s segments, 40 Mbit/s): main fails 3 of 3 zaps with the reporter's exact line, 'probe failed (Demuxer: stream info failed (Operation not permitted (-1)))' after '[HLSIngest] terminal: playlistUnreachable(403)'; this branch plays 3 of 3 at t+3.54..3.71 s with peak inflight 1. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #678.
What changes
ceil(longest / 1.5)). The join used to cover onlymax(8, 1.5 x advertised TD), which is always a little short of the3 x TDholdback the first serve waits for. It now covers that holdback plus one GOP, capped at 4 s. With 10 s segments this means joining 3 segments instead of 2.OriginRequestBudget. Every playlist, segment and key fetch now takes a ticket and reports refusals and redirects. The prefetch window shrinks to the origin's limit, and a direct.custom(HLSLiveIngestReader)load registers the host's ceiling on its playlist URL..m3u8/.m3u, or that has already taken the AE#363 reroute in this process, goes straight onto the ingest.preferredDisplayCriteriaback and writes again if the host cleared it.[Demuxer] open timingslog line. It splits connect / open_input / find_stream_info, including when the stream analysis fails.LoadOptions.probesize. The documentation claimed a probe budget that is too tight always fails open. That is wrong when no stream resolves.Measured
Setup:
hlsfixture --segments-dirserving 10 s segments with a 1 s GOP, window 6, driven byplay --live --fast-zap. The two arms alternated within each repeat, 3 runs per arm and row.--max-concurrent-requests 1[HLSIngest] terminal: playlistUnreachable(403)thenprobe failed (Demuxer: stream info failed (Operation not permitted (-1))), the reporter's exact lineOn the 403 proxy the branch still starts through the bounded grace (9 s < 21 s). With serial fetches, the third 10 s segment arrives after the 1 s grace, so the window is shallow at start. No CoreMedia errors in any run.
swift test: XCTest 655 tests, swift-testing 3942 tests, 0 failures.Not verifiable on macOS: the display-criteria read-back (tvOS only) still needs a device check. If tvOS nils
preferredDisplayCriteriaon its own, the new log linecriteria were cleared outside the enginewill show up on every zap in Sodalite, which never clears it itself.🤖 Generated with Claude Code
https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS