1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2024-05-19 16:58:04 +00:00
This commit is contained in:
jensenn 2023-09-11 13:56:17 +00:00 committed by GitHub
commit 2e22213f0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -35,6 +35,9 @@ impl MoovBox {
if let Some(meta) = &self.meta {
size += meta.box_size();
}
if let Some(mvex) = &self.mvex {
size += mvex.box_size();
}
if let Some(udta) = &self.udta {
size += udta.box_size();
}
@ -137,6 +140,9 @@ impl<W: Write> WriteBox<&mut W> for MoovBox {
if let Some(meta) = &self.meta {
meta.write_box(writer)?;
}
if let Some(mvex) = &self.mvex {
mvex.write_box(writer)?;
}
if let Some(udta) = &self.udta {
udta.write_box(writer)?;
}
@ -154,7 +160,7 @@ mod tests {
fn test_moov() {
let src_box = MoovBox {
mvhd: MvhdBox::default(),
mvex: None, // XXX mvex is not written currently
mvex: Some(MvexBox::default()),
traks: vec![],
meta: Some(MetaBox::default()),
udta: Some(UdtaBox::default()),

View file

@ -12,7 +12,7 @@ pub struct MvexBox {
impl MvexBox {
pub fn get_type(&self) -> BoxType {
BoxType::MdiaBox
BoxType::MvexBox
}
pub fn get_size(&self) -> u64 {