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
This commit is contained in:
2025-11-07 12:42:11 +01:00
parent 82cbe6c1b7
commit a6e4ff9df9
+2 -2
View File
@@ -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)