src.nth.io/

summaryrefslogtreecommitdiff
path: root/main/display.h
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-06-20 12:20:48 -0500
committerLuke Hoersten <[email protected]>2026-06-20 12:20:48 -0500
commite3bcccaf63cb5feafb048cc32b1ca7bf6688fba1 (patch)
treeeb040e658beafffd04e8c99543d943d585c87d00 /main/display.h
parentfb4e900636dc0828eba2e70f1bbd0ef53a0bcabd (diff)
scrypted: max_node_buf_mb cap → destroy+reconnect socket to drop entire backlog
User's intent: "we want to see what's going on right now, not all the shit we throttled and backlogged in the buffer." Dropping new arrivals when the buffer is full doesn't help — the already-queued frames still get processed in order, painting 5+ seconds of stale content before catching up to live. Better: when the buffer exceeds the configured cap, blow away the whole queue by destroying the socket. The firmware's accept_task picks up the next reconnect within ~500ms and the pipeline restarts with the freshest ffmpeg frame as seq=1. Trade a sub-second visual gap for clearing the entire backlog instantly. Per-viewport setting "Max Scrypted-side buffer (MB)" under Display. Default 20 MB (≈5s buffering ceiling at our measured ~3.5 MB/s ffmpeg → firmware throughput). Range 1-200. Lower for tighter g2g at cost of more frequent reconnect gaps under sustained backpressure; higher to tolerate longer backlogs before flushing. flushCount tracked per-stream and surfaced in the unified log line alongside drops, plus node_buf shown vs the cap so the user can see how close they're running to the threshold. Demux loop now: if !socketReady → drop. Else if writableLength > cap*MB → log + sock.destroy() + increment flushes. Else normal write.
Diffstat (limited to 'main/display.h')
0 files changed, 0 insertions, 0 deletions