diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2022-03-28 12:17:34 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2022-03-28 12:17:34 +0300 |
commit | 518e43fc5fdd2199139fac9ca048ac9e7c26e165 (patch) | |
tree | 01ac253619a994585595a02ecfb5467d16e2d9cc /video | |
parent | 59ca466081204df18aab0f3ec271c6f0843b3d29 (diff) |
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).
Diffstat (limited to 'video')
-rw-r--r-- | video/closedcaption/src/cea608tott/imp.rs | 4 |
1 files 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(); |