From a8a11935fe2cc43ef279c8eeabfe12ee4f23c948 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 24 Mar 2025 17:45:59 +0100 Subject: [PATCH] print last valid time instead of question marks when current time is unknown --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index 4bfc098..317dac2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -604,6 +604,7 @@ fn main() { let mut adata_size = 0; let mut vdata_size = 0; let mut cur_dmx = 0; + let mut last_known_time = None; 'main_loop: loop { let mut pktres = Err(DemuxerError::EOF); let mut src_dmx = 0; @@ -642,6 +643,9 @@ fn main() { if let Some(pts) = pkt.get_pts() { let cur_time = format_time(NATimeInfo::ts_to_time(pts, 1000, pkt.ts.tb_num, pkt.ts.tb_den)); print!(" {}", cur_time); + last_known_time = Some(cur_time); + } else if let Some(ref time) = last_known_time { + print!(" {time}"); } else { print!(" ???"); } -- 2.39.5