From: Kostya Shishkov Date: Mon, 24 Mar 2025 16:48:54 +0000 (+0100) Subject: fix the bug with minimum duration calculation X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=HEAD;p=nihav-encoder.git fix the bug with minimum duration calculation It should be minimal known duration, previously it was always set to zero. --- 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