From 4a12eacef7fc5ea33f98c58069d6ccdb3a16926f Mon Sep 17 00:00:00 2001 From: buenosairesam Date: Fri, 3 Apr 2026 11:05:42 -0300 Subject: [PATCH] update buffer --- cht/stream/manager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cht/stream/manager.py b/cht/stream/manager.py index 25e6629..620f303 100644 --- a/cht/stream/manager.py +++ b/cht/stream/manager.py @@ -10,6 +10,7 @@ Architecture: import json import logging +import os import re import time from queue import Queue, Empty @@ -266,8 +267,11 @@ class StreamManager: frame_num = start_number offset = self.current_global_offset buf = b"" + raw_fd = proc.stdout.fileno() while True: - chunk = proc.stdout.read(4096) + # os.read on the raw fd returns as soon as ANY data is available + # (no Python buffered-IO blocking waiting to fill a buffer) + chunk = os.read(raw_fd, 65536) if not chunk: break buf += chunk