From 237f22d1319b1e47f9bc402d772e8d4b18eebdc6 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Wed, 6 Mar 2024 02:37:16 +0900 Subject: [PATCH] sccparse: Ignore invalid timecode during seek as well sccparse holds last timecode in order to ignore invalid timecode and fallback to the previous timecode. That should happen when sccparse is handling seek event too. Otherwise single invalid timecode before the target seek position will cause flow error. Part-of: --- video/closedcaption/src/scc_parse/imp.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video/closedcaption/src/scc_parse/imp.rs b/video/closedcaption/src/scc_parse/imp.rs index ae0e9945..1289bf3e 100644 --- a/video/closedcaption/src/scc_parse/imp.rs +++ b/video/closedcaption/src/scc_parse/imp.rs @@ -381,6 +381,10 @@ impl SccParse { // Still need to scan lines to find the first buffer if state.seeking { + // Remember this timecode in order to fallback to this one + // if invalid timecode is detected during scanning + state.last_timecode = Some(timecode); + drop(state); return Ok(self.state.lock().unwrap()); }