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).
This commit is contained in:
Sebastian Dröge 2022-03-28 12:17:34 +03:00
parent 59ca466081
commit 518e43fc5f

View file

@ -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();