From cab4cd3b8c0fa9e2eeed47df5648777f0c465303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 26 Oct 2022 20:19:27 +0300 Subject: [PATCH] fmp4mux: If a stream is longer than the main stream at EOS, simply include all of its buffers in the last fragment nonetheless --- mux/fmp4/src/fmp4mux/imp.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs index ebe1f296..22e9bf19 100644 --- a/mux/fmp4/src/fmp4mux/imp.rs +++ b/mux/fmp4/src/fmp4mux/imp.rs @@ -689,7 +689,9 @@ impl FMP4Mux { // If this GOP starts after the fragment end then don't dequeue it yet unless this is // the first stream and no GOPs were dequeued at all yet. This would mean that the // GOP is bigger than the fragment duration. - if gop.end_pts > dequeue_end_pts && (fragment_end_pts.is_some() || !gops.is_empty()) + if !at_eos + && gop.end_pts > dequeue_end_pts + && (fragment_end_pts.is_some() || !gops.is_empty()) { break; }