diff options
| author | Luke Hoersten <[email protected]> | 2026-06-15 09:32:57 -0500 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2026-06-15 09:32:57 -0500 |
| commit | 0ff5d03b760d726f6151cd5f3f23ef1a1039d319 (patch) | |
| tree | 2e0e907bea9129d0e32f4f3f6602cd3dcfb31988 /scrypted/package.json | |
| parent | 28a6335576cfec144dc3860bc47f7f6d87274651 (diff) | |
add X-Frame-Seq monotonic ordering for pipelined /frame POSTs
With two /frame POSTs in flight on separate sockets, the firmware's
JPEG decoder mutex serialises decode but FreeRTOS semaphore
acquisition is not FIFO — under jitter the later-arriving older
frame can grab the lock first and paint over the newer one,
producing brief "panel travels backward in time" glitches.
Scrypted side:
- Per-viewport monotonic frameSeq counter, sent as X-Frame-Seq on
every /frame POST. Reset on stopStream so each new stream starts
at 1.
Firmware side:
- s_last_painted_seq tracks the highest seq we've painted. Frame
arrives, mutex acquired, body received — if seq <= s_last_painted_seq
the frame is dropped (200 OK + X-Frame-Drop: stale-seq header) and
the mutex released without touching the back buffer.
- s_last_painted_seq resets to 0 on POST /state {wake} so the next
stream's seq=1 isn't rejected because the previous session reached
a higher counter.
- Missing/zero X-Frame-Seq (legacy clients) skips the check entirely
— preserves pre-pipelining behaviour.
Diffstat (limited to 'scrypted/package.json')
0 files changed, 0 insertions, 0 deletions
