From 51ff0992215a2a9c16a6b34ea4da2fa45faaf03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 26 Oct 2022 20:20:27 +0300 Subject: [PATCH] fmp4mux: Reset timing infos to None if a stream only contained gap events for a whole fragment --- mux/fmp4/src/fmp4mux/imp.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs index 22e9bf19..ef2a9ae8 100644 --- a/mux/fmp4/src/fmp4mux/imp.rs +++ b/mux/fmp4/src/fmp4mux/imp.rs @@ -1239,12 +1239,16 @@ impl FMP4Mux { ) = self.drain_buffers(state, settings, timeout, at_eos)?; // Remove all GAP buffers before processing them further - for (_, _, buffers) in &mut drained_streams { + for (_, timing_info, buffers) in &mut drained_streams { buffers.retain(|buf| { !buf.buffer.flags().contains(gst::BufferFlags::GAP) || !buf.buffer.flags().contains(gst::BufferFlags::DROPPABLE) || buf.buffer.size() != 0 }); + + if buffers.is_empty() { + *timing_info = None; + } } // For ONVIF, replace all timestamps with timestamps based on UTC times.