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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1508>
This commit is contained in:
Seungha Yang 2024-03-06 02:37:16 +09:00 committed by Guillaume Desmottes
parent 7a90e96332
commit 2cb76f2ff2

View file

@ -378,6 +378,10 @@ impl SccParse {
// Still need to scan lines to find the first buffer // Still need to scan lines to find the first buffer
if state.seeking { 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); drop(state);
return Ok(self.state.lock().unwrap()); return Ok(self.state.lock().unwrap());
} }