From 518e43fc5fdd2199139fac9ca048ac9e7c26e165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 28 Mar 2022 12:17:34 +0300 Subject: [PATCH] cea608tott: Don't zero-pad SRT indices but zero-pad hours to at least two digits Zero-padding is not specified for the indices but all time components need to be zero-padded (3 digits for fractional seconds, 2 digits for everything else). --- video/closedcaption/src/cea608tott/imp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video/closedcaption/src/cea608tott/imp.rs b/video/closedcaption/src/cea608tott/imp.rs index ee56f953..622ea915 100644 --- a/video/closedcaption/src/cea608tott/imp.rs +++ b/video/closedcaption/src/cea608tott/imp.rs @@ -232,10 +232,10 @@ impl Cea608ToTt { let (h1, m1, s1, ms1) = Self::split_time(timestamp); let (h2, m2, s2, ms2) = Self::split_time(timestamp + duration); - writeln!(&mut data, "{:02}\r", index).unwrap(); + writeln!(&mut data, "{}\r", index).unwrap(); writeln!( &mut data, - "{}:{:02}:{:02},{:03} --> {:02}:{:02}:{:02},{:03}\r", + "{:02}:{:02}:{:02},{:03} --> {:02}:{:02}:{:02},{:03}\r", h1, m1, s1, ms1, h2, m2, s2, ms2 ) .unwrap();