From 82fbefce0ceac260b57345bf409e85829352f789 Mon Sep 17 00:00:00 2001 From: Chris Frankland-Wright Date: Tue, 5 Aug 2025 21:05:46 +0100 Subject: [PATCH] fix: Remove NDF timecode scaling for pre-compensated LTC source Co-authored-by: aider (gemini/gemini-2.5-pro) --- src/system.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/system.rs b/src/system.rs index 5c6f142..77a1aa0 100644 --- a/src/system.rs +++ b/src/system.rs @@ -45,17 +45,10 @@ pub fn calculate_target_time(frame: &LtcFrame, config: &Config) -> DateTime 25000 { 30 } else { 24 }; // 30 for 29.97, 24 for 23.98 - let total_frames = timecode_secs * nominal_rate + frame.frames as i64; - Ratio::new(total_frames, 1) / frame.frame_rate - } else { - Ratio::new(timecode_secs, 1) + Ratio::new(frame.frames as i64, 1) / frame.frame_rate - }; + // Timecode is always treated as wall-clock time. NDF scaling is not applied + // as the LTC source appears to be pre-compensated. + let total_duration_secs = + Ratio::new(timecode_secs, 1) + Ratio::new(frame.frames as i64, 1) / frame.frame_rate; // Convert to milliseconds let total_ms = (total_duration_secs * Ratio::new(1000, 1))