Files
XC_VM/src
Divarion_D 4902e953a0 fix(streaming): fill the on-demand prebuffer before the first TS burst
For continuous-TS delivery (/play/<token>/ts) the client's whole playback buffer
is the initial prebuffer burst — the feed loop then runs in real time, so the
buffer never grows past it. On a cold on-demand start the server began serving
the instant the playlist first appeared, when only the 1-2 fast-start (2s)
segments existed, so selectSegments could only return ~2s and the client was
stranded at ~2s of buffer regardless of client_prebuffer.

Wait until the playlist actually holds client_prebuffer seconds (bounded by
on_demand_wait_time, bailing if the stream stops) before the first read. Clients
only — restreamer chains keep their low-latency behaviour; warm streams already
satisfy the condition and don't wait. Adds SegmentReader::playlistBufferedSeconds()
(sum of #EXTINF) as the gate.

Validated live on stream 567: at cold start OLD served 1 seg / 2.0s; NEW served
5 seg / 10.0s after a 0.2s wait (fast-start pre-generates segments, so the added
startup latency is negligible).

Verified: php -l, phpunit (SegmentReaderTest 10/10), make gates.
2026-08-09 00:04:04 +03:00
..
2025-07-10 20:01:56 +03:00
2025-09-11 22:09:58 +03:00
2026-08-02 11:55:34 +03:00
2026-07-10 19:58:19 +03:00
2025-07-10 20:01:56 +03:00
2025-07-10 20:01:56 +03:00