From fe5bdfb11f1abaa7cc1c4ce5546706f4f1b7a4eb Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 24 Mar 2025 17:48:54 +0100 Subject: [PATCH] fix the bug with minimum duration calculation It should be minimal known duration, previously it was always set to zero. --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 317dac2..437b617 100644 --- a/src/main.rs +++ b/src/main.rs @@ -427,7 +427,9 @@ fn main() { let duration = demuxers.iter().fold(0u64, |mindur, (dmx, _)| { let dur = dmx.get_duration(); - if dur > 0 { + if mindur == 0 { + dur + } else if dur > 0 { mindur.min(dur) } else { mindur -- 2.39.5