diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2022-09-15 18:11:10 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2022-09-16 14:54:33 +0300 |
commit | 7e13ea4ba9f166781705b1db47e9584400e123b3 (patch) | |
tree | 951f692451fac41b99e4187348d78d9fd410533f /generic | |
parent | 1fa39d0ab4a5c0cd858f6d6abdef8185de89b15b (diff) |
fmp4mux: Drop gap buffers before further processing
They would potentially change timestamps and will break in ONVIF mode.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/fmp4/src/fmp4mux/imp.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/generic/fmp4/src/fmp4mux/imp.rs b/generic/fmp4/src/fmp4mux/imp.rs index 306ec6871..2e9ff88fb 100644 --- a/generic/fmp4/src/fmp4mux/imp.rs +++ b/generic/fmp4/src/fmp4mux/imp.rs @@ -889,6 +889,15 @@ impl FMP4Mux { } } + // Remove all GAP buffers before processing them further + for buffers in &mut drain_buffers { + buffers.retain(|buf| { + !buf.buffer.flags().contains(gst::BufferFlags::GAP) + || !buf.buffer.flags().contains(gst::BufferFlags::DROPPABLE) + || buf.buffer.size() != 0 + }); + } + let mut max_end_utc_time = None; // For ONVIF, replace all timestamps with timestamps based on UTC times. if class.as_ref().variant == super::Variant::ONVIF { @@ -1196,13 +1205,6 @@ impl FMP4Mux { if interleaved_buffers.is_empty() { assert!(timeout || at_eos); } else { - // Remove all GAP buffers before writing them out - interleaved_buffers.retain(|buf| { - !buf.buffer.flags().contains(gst::BufferFlags::GAP) - || !buf.buffer.flags().contains(gst::BufferFlags::DROPPABLE) - || buf.buffer.size() != 0 - }); - let min_earliest_pts_position = min_earliest_pts_position.unwrap(); let min_earliest_pts = min_earliest_pts.unwrap(); let max_end_pts = max_end_pts.unwrap(); |