Skip to content

fix writing mvex box #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/mp4box/moov.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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)?;
}
Expand All @@ -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()),
Expand Down
2 changes: 1 addition & 1 deletion src/mp4box/mvex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down