Merge pull request #29 from cjfranko/non-fractional-mismatch-tc

fixed some sync issues, fractional still an issue at 29.97 NDF

Drift issues with all fractionals, 29.97NDF has a system clock sync issue
This commit is contained in:
Chris Frankland-Wright 2025-08-07 19:56:08 +01:00 committed by GitHub
commit 69569c0a01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 141 additions and 42 deletions

View file

@ -24,6 +24,7 @@ pub struct LtcFrame {
pub minutes: u32,
pub seconds: u32,
pub frames: u32,
pub is_drop_frame: bool,
pub frame_rate: Ratio<i64>,
pub timestamp: DateTime<Utc>, // arrival stamp
}
@ -35,8 +36,9 @@ impl LtcFrame {
hours: caps[2].parse().ok()?,
minutes: caps[3].parse().ok()?,
seconds: caps[4].parse().ok()?,
frames: caps[5].parse().ok()?,
frame_rate: get_frame_rate_ratio(&caps[6])?,
is_drop_frame: &caps[5] == ";",
frames: caps[6].parse().ok()?,
frame_rate: get_frame_rate_ratio(&caps[7])?,
timestamp,
})
}
@ -205,6 +207,7 @@ mod tests {
minutes: m,
seconds: s,
frames: 0,
is_drop_frame: false,
frame_rate: Ratio::new(25, 1),
timestamp: Utc::now(),
}