mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-10 11:15:33 +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/1017>
This commit is contained in:
parent
6596b6cdd1
commit
6ceccac1be
1 changed files with 10 additions and 0 deletions
|
@ -782,6 +782,16 @@ impl MP4Mux {
|
||||||
&& buffer.buffer.size() == 0
|
&& buffer.buffer.size() == 0
|
||||||
{
|
{
|
||||||
gst::trace!(CAT, obj: stream.sinkpad, "Skipping gap buffer {buffer:?}");
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue