From a6e4ff9df97ea00f49820cc42e4ee78fdabf6d5b Mon Sep 17 00:00:00 2001 From: pstruebi Date: Fri, 7 Nov 2025 12:42:11 +0100 Subject: [PATCH] fix: correct static drop threshold for drift compensation - Changed static_drop_ms from drift_threshold_ms to 2ms for more accurate frame dropping behavior - Removed outdated cooldown comment that no longer matches the implementation --- src/auracast/multicast.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auracast/multicast.py b/src/auracast/multicast.py index e59433d..2e49c2a 100644 --- a/src/auracast/multicast.py +++ b/src/auracast/multicast.py @@ -695,8 +695,8 @@ class Streamer(): enable_drift_compensation = getattr(global_config, 'enable_adaptive_frame_dropping', False) # Hardcoded parameters (unit: milliseconds) drift_threshold_ms = 2.0 if enable_drift_compensation else 0.0 - static_drop_ms = drift_threshold_ms if enable_drift_compensation else 0.0 - # Guard interval measured in LC3 frames (10 ms each); 50 => 500 ms cooldown + static_drop_ms = 2 if enable_drift_compensation else 0.0 + # Guard interval measured in LC3 frames (10 ms each) discard_guard_frames = int(sample_rate / 1000) // 2 if enable_drift_compensation else 0 # Derived sample counts drop_threshold_samples = int(sample_rate * drift_threshold_ms / 1000.0)