Repository navigation
perf(hls): subtitles served from the window walks; audit fixes for over-reads and declared-size allocations - #32
Closed
gravity-zero wants to merge 11 commits into
Closed
gravity-zero wants to merge 11 commits into
gravity-zero wants to merge 11 commits into
Conversation
…instead of walking the file again
… window longer than a stride, nor the last
…o declared cluster size
…ive instead of allocating its declared size
…er an open-ended one
…lk serves the other subtitles, and damage costs the harvest one cluster
…quest again, a network one does not
Merged
Owner
Author
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.
On-demand HLS read the source far more than it served once subtitles were involved. This branch removes that and fixes what two follow-up audits found along the way. Every fix comes with a test that is red before it.
Subtitles without a second walk (
PlanHLS)Before: without a subtitle index, each subtitle rendition walked the clusters again, on top of the walks of the video windows.
Now: the window walks keep the subtitle blocks they pass over, and a subtitle request takes its cues from them. It builds the windows it lacks, which the video then serves from.
Shared walk: a subtitle cursor's own walk serves the other subtitle tracks.
Damaged regions: one costs the harvest only the cluster it lies in.
Exactness kept:
New counter:
HLSPlanStats.SubtitleHarvestedClusters.Measured on real 1080p files, bytes asked of the source:
Identity checks: WebVTT and media segments are byte-identical to the old walk in every request order, seek and damage case tested, and across 18 scenarios (3 files x sequential/seek/tail x local/network).
Audit fixes
SynthesizeIndexgoes on past a damaged region instead of ending the index there. A damaged 43 min episode planned 35 windows, the last one served as a single 2.2 GB segment; it now plans 309.AudioStartDelays(andDiagnose) seeks over what precedes the first cluster instead of reading it. The attachments were read on every call: 26 MB -> 5.3 MB on a file with a 20 MiB font.AudioStartDelays,retime,reindex: 200 MiB for a 32-byte file.mkv.RangeHinter) is never asked for an open-ended range.Checks