src.nth.io/

summaryrefslogtreecommitdiff
path: root/main/stream_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/stream_server.c')
-rw-r--r--main/stream_server.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/main/stream_server.c b/main/stream_server.c
index 10d1e1b..38769f0 100644
--- a/main/stream_server.c
+++ b/main/stream_server.c
@@ -133,13 +133,9 @@ static void handle_client(int fd, const char *peer)
continue;
}
- // "Always paint the latest" — if the socket already has more
- // bytes queued in the kernel receive buffer, at least one more
- // header is on the way. The frame we just finished receiving
- // is no longer the freshest possible; skip its decode+paint
- // (saves ~6ms per skip) and loop straight to the next header.
- // This trades some intermediate frames for lower
- // glass-to-glass latency on the latest one.
+ // If the kernel already has another header queued, this frame
+ // is no longer the freshest; skip decode + paint, loop back to
+ // the head-of-queue header.
int queued = 0;
if (ioctl(fd, FIONREAD, &queued) == 0 && queued >= HEADER_BYTES) {
jpeg_decoder_unlock();