From 68bec4a0db30a95aa6d6ef050e6fba2b12885b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 1 Feb 2023 14:56:03 +0200 Subject: [PATCH] fmp4mux: Fix a couple of assertions by handling these cases cleaner Part-of: --- mux/fmp4/src/fmp4mux/imp.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs index 764e550b..ae246ea3 100644 --- a/mux/fmp4/src/fmp4mux/imp.rs +++ b/mux/fmp4/src/fmp4mux/imp.rs @@ -1271,9 +1271,10 @@ impl FMP4Mux { gst::trace!( CAT, obj: stream.sinkpad, - "Draining up to end PTS {} / duration {}", + "Draining from {} up to end PTS {} / duration {}", + chunk_start_pts, dequeue_end_pts, - dequeue_end_pts - chunk_start_pts + dequeue_end_pts.saturating_sub(chunk_start_pts), ); while let Some(gop) = stream.queued_gops.back() { @@ -1444,9 +1445,10 @@ impl FMP4Mux { gst::trace!( CAT, obj: stream.sinkpad, - "Draining up to end PTS {} / duration {}", + "Draining from {} up to end PTS {} / duration {}", + chunk_start_pts, dequeue_end_pts, - dequeue_end_pts - chunk_start_pts + dequeue_end_pts.saturating_sub(chunk_start_pts), ); while let Some(gop) = stream.queued_gops.back() { @@ -1769,9 +1771,6 @@ impl FMP4Mux { if all_eos || stream.sinkpad.is_eos() { // This is handled below generally if nothing was dequeued } else { - // Otherwise this can only really happen on timeout in live pipelines. - assert!(timeout); - if settings.chunk_duration.is_some() { gst::warning!( CAT, @@ -2318,7 +2317,6 @@ impl FMP4Mux { Err(err) => { if err == gst_base::AGGREGATOR_FLOW_NEED_DATA { assert!(!all_eos); - assert!(timeout); gst::element_imp_warning!( self, gst::StreamError::Format,