mp4mux: Skip gap buffers instead of writing empty samples

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/974>
This commit is contained in:
Sebastian Dröge 2022-11-10 10:51:10 +02:00
parent 2b4fd40d62
commit 4d310434ab

View file

@ -783,6 +783,14 @@ impl MP4Mux {
let stream = &mut state.streams[idx];
let buffer = stream.pending_buffer.take().unwrap();
if buffer.buffer.flags().contains(gst::BufferFlags::GAP)
&& buffer.buffer.flags().contains(gst::BufferFlags::DROPPABLE)
&& buffer.buffer.size() == 0
{
gst::trace!(CAT, obj: stream.sinkpad, "Skipping gap buffer {buffer:?}");
continue;
}
gst::trace!(CAT, obj: stream.sinkpad, "Handling buffer {buffer:?} at offset {}", state.current_offset);
let duration = buffer.duration.unwrap();