mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 11:30:59 +00:00
mp4mux: Don't write empty chunks at the end if the last buffer of a stream started a new chunk and happened to be a from a gap event
Empty chunks are not valid in MP4. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1014>
This commit is contained in:
parent
42385c81be
commit
f8024f072f
1 changed files with 10 additions and 0 deletions
|
@ -779,6 +779,16 @@ impl MP4Mux {
|
|||
&& buffer.buffer.size() == 0
|
||||
{
|
||||
gst::trace!(CAT, obj: stream.sinkpad, "Skipping gap buffer {buffer:?}");
|
||||
|
||||
// If a new chunk was just started for the gap buffer, don't bother and get rid
|
||||
// of this chunk again for now and search for the next stream.
|
||||
if let Some(chunk) = stream.chunks.last() {
|
||||
if chunk.samples.is_empty() {
|
||||
let _ = stream.chunks.pop();
|
||||
state.current_stream_idx = None;
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue