From 4eeb8ffb6364599596fac0340e5d020c9aa23095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 24 Jan 2023 19:52:44 +0200 Subject: [PATCH] fmp4mux: Don't write the first sample flags into any trun but the first The flags are based on the first sample of this fragment so writing it into any trun but the first is not very useful. Part-of: --- mux/fmp4/src/fmp4mux/boxes.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mux/fmp4/src/fmp4mux/boxes.rs b/mux/fmp4/src/fmp4mux/boxes.rs index 44ec1f7a2..0a2046cfe 100644 --- a/mux/fmp4/src/fmp4mux/boxes.rs +++ b/mux/fmp4/src/fmp4mux/boxes.rs @@ -1836,7 +1836,7 @@ fn write_traf( // has to be stored for every single sample let ( tf_flags, - tr_flags, + mut tr_flags, default_size, default_duration, default_flags, @@ -1892,6 +1892,9 @@ fn write_traf( current_data_offset = (current_data_offset as u64 + run.iter().map(|b| b.buffer.size() as u64).sum::()) .try_into()?; + + // Don't include first sample flags in any trun boxes except for the first + tr_flags &= !FIRST_SAMPLE_FLAGS_PRESENT; } // TODO: saio, saiz, sbgp, sgpd, subs?