1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2024-06-02 13:39:54 +00:00

fix(traf): box size didn't include tfdt

This commit is contained in:
Stuart Woodbury 2023-07-14 12:13:42 -04:00
parent 8ce513414c
commit 23b8c86eec

View file

@ -19,9 +19,8 @@ impl TrafBox {
pub fn get_size(&self) -> u64 {
let mut size = HEADER_SIZE;
size += self.tfhd.box_size();
if let Some(ref trun) = self.trun {
size += trun.box_size();
}
size += self.tfdt.as_ref().map(|x| x.box_size()).unwrap_or(0);
size += self.trun.as_ref().map(|x| x.box_size()).unwrap_or(0);
size
}
}