From 8bb0a7eecc0bc659be6379df45b47b1702942493 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 28 Nov 2024 16:52:07 +0100 Subject: [PATCH] tttocea708: Fix off-by-one issue last_frame_no is used to eventually calculate the outgoing pts. We want to increment it *after* having created the content Part-of: --- video/closedcaption/src/tttocea708/translate.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video/closedcaption/src/tttocea708/translate.rs b/video/closedcaption/src/tttocea708/translate.rs index 43b98cb7..2ee71ff4 100644 --- a/video/closedcaption/src/tttocea708/translate.rs +++ b/video/closedcaption/src/tttocea708/translate.rs @@ -260,8 +260,6 @@ impl TextToCea708 { fn cc_data(&mut self) { self.check_erase_display(); - self.last_frame_no += 1; - let seq_no = self.sequence_no; self.sequence_no = (self.sequence_no + 1) & 0x3; @@ -300,6 +298,8 @@ impl TextToCea708 { packet: cc_data[2..].to_vec(), frame_no: self.last_frame_no, }); + + self.last_frame_no += 1; } fn pad(&mut self, frame_no: u64) {