mirror of
https://github.com/alfg/mp4-rust.git
synced 2024-05-19 08:48:04 +00:00
fix writing mvex box
This commit is contained in:
parent
35560e94f5
commit
125ba6abb2
|
@ -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()),
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue