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
Direct-play embedded subtitles: forward cue exposure bounded by the producer park breaks host advance-offsets (text and bitmap) #151
On the loopback-HLS path, a host that renders $subtitleCues in its own overlay and applies a negative (advance) subtitle sync offset queries cues several seconds ahead of the playhead — for both text (.text/.richText) and bitmap (.image) tracks.
subtitleDrainLeadSeconds is 60, but SubtitlePacketStore notes forward exposure is bounded by the segment producer's forward park (#102), so in practice only ~2-3 s of cues exist ahead of the playhead on a direct-play stream. A delay offset works (300 s retention behind the playhead), but an advance beyond the park shows nothing, or the cue flashes in late and is cut short as the window catches up. SRT and PGS alike, since both flow through the same side-demuxer drain.
Preferred resolution: let the subtitle side-demuxer read/produce further ahead — toward the 60 s drain lead — independent of the video producer's forward park, so both text and bitmap cues are available for a host-applied advance offset.
Alternative, text only: confirm whether prepareNativeSubtitles + eagerNativeSubtitleReaders populate a finishedNativeSubtitleCueStore for embedded text tracks that a host could pull whole via $subtitleCues (analogous to the #88 external-track backfill). That would fix text client-side but not bitmap (which prepareNativeSubtitles excludes), so the forward-production approach is the one that covers both.
Context: we render engine subtitles in our own overlay with a user-tunable sync offset (mkvmerge convention). Delay is solid; advance is where users hit this. Repro: any direct-play MKV with embedded SRT or PGS, advance the offset a few seconds.
Fixed in 5.9.7 via #156, using the forward-production approach you preferred, so it covers text and bitmap alike.
What ships:
A VOD-only subtitle forward prefetcher: a subtitle-only side reader that fills the session packet store up to playhead + 60 s (the full subtitleDrainLeadSeconds) independent of the producer's forward park. The drainer already decoded to +60 s once packets existed, so $subtitleCues now actually holds that window and an advance offset up to roughly 60 s has cues to land on. Delay offsets are unchanged (300 s trailing retention).
Split-PES PGS display sets (MPEG-TS) now assemble under a per-writer key in the store, so the pump and the prefetcher can feed the same stream concurrently without corrupting each other's in-flight set.
Live sessions skip it (content past the edge does not exist), and it is best-effort: if the side demuxer cannot open or wedges, behavior is exactly the previous tap-fed path.
On your alternative: embedded text tracks do fill native cue stores via the pump tap, but that coverage is bounded by the same producer park, and prepareNativeSubtitles indeed excludes bitmap, so the forward-production route was the right call.
When the prefetcher engages you should see #151 forward prefetch started: streams=[...] startAt=...s lead=60.0s in the log, and cue queries a few seconds ahead of the playhead should return populated results for both SRT and PGS on a direct-play MKV. Please retest with an advance offset on your side and reopen if anything still comes up short.
Activity
Merge feature/issue151-subtitle-forward-prefetch: subtitle forward pr…
docs: changelog entry for 5.9.7 (#151 subtitle forward prefetcher)
superuser404notfound commentedon Jul 19, 2026
Fixed in 5.9.7 via #156, using the forward-production approach you preferred, so it covers text and bitmap alike.
What ships:
playhead + 60 s(the fullsubtitleDrainLeadSeconds) independent of the producer's forward park. The drainer already decoded to +60 s once packets existed, so$subtitleCuesnow actually holds that window and an advance offset up to roughly 60 s has cues to land on. Delay offsets are unchanged (300 s trailing retention).On your alternative: embedded text tracks do fill native cue stores via the pump tap, but that coverage is bounded by the same producer park, and
prepareNativeSubtitlesindeed excludes bitmap, so the forward-production route was the right call.When the prefetcher engages you should see
#151 forward prefetch started: streams=[...] startAt=...s lead=60.0sin the log, and cue queries a few seconds ahead of the playhead should return populated results for both SRT and PGS on a direct-play MKV. Please retest with an advance offset on your side and reopen if anything still comes up short.fix(subtitles): forward prefetcher fills the drain lead window past t…
feat(subtitles): arm OCR worker on bitmap selection, raise prefetch l…
diag(memory): surface the prefetch lead and both reader windows (#220)
fix(subtitles): stop memoizing a failed time-base lookup in the prefe…
fix(subtitles): park the side readers on the read position, not on th…
diag(memory): census live malloc blocks by size class (superuser404no…
fix(subtitles): give the video path priority on the source link
chore(release): prep 6.0.1 - LibDovi 2.0.0, side-reader yield accounting
feat(subtitles): generation-fenced subtitle-resolution statement (sup…
diag(subtitles): the prefetch cancel says who cancelled it (#496)
feat(subtitles): one read of the source, the forward prefetcher only …
feat(subtitles): the forward prefetch reads the container's index, th…
test(subtitles): fold the AE#1015 cases into the forward-prefetch tes…
fix(subtitles): a zero offset reach stops the forward prefetch's seco…