fmp4mux: Reset timing infos to None if a stream only contained gap events for a whole fragment

This commit is contained in:
Sebastian Dröge 2022-10-26 20:20:27 +03:00 committed by Sebastian Dröge
parent cab4cd3b8c
commit 27fac33c44

View file

@ -1239,12 +1239,16 @@ impl FMP4Mux {
) = self.drain_buffers(state, settings, timeout, at_eos)?; ) = self.drain_buffers(state, settings, timeout, at_eos)?;
// Remove all GAP buffers before processing them further // 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| { buffers.retain(|buf| {
!buf.buffer.flags().contains(gst::BufferFlags::GAP) !buf.buffer.flags().contains(gst::BufferFlags::GAP)
|| !buf.buffer.flags().contains(gst::BufferFlags::DROPPABLE) || !buf.buffer.flags().contains(gst::BufferFlags::DROPPABLE)
|| buf.buffer.size() != 0 || buf.buffer.size() != 0
}); });
if buffers.is_empty() {
*timing_info = None;
}
} }
// For ONVIF, replace all timestamps with timestamps based on UTC times. // For ONVIF, replace all timestamps with timestamps based on UTC times.