1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2024-05-19 16:58:04 +00:00

fix(reader): didn't compile

This commit is contained in:
Stuart Woodbury 2023-07-14 16:57:27 -04:00
parent 4b88f0459e
commit 4d676b9da2

View file

@ -97,7 +97,12 @@ impl<R: Read + Seek> Mp4Reader<R> {
let mut default_sample_duration = 0;
if let Some(ref moov) = moov {
if let Some(ref mvex) = &moov.mvex {
default_sample_duration = mvex.trex.default_sample_duration
// todo: do this better. matches the original behavior before mvex.trex was changed to an array.
default_sample_duration = mvex
.trex
.first()
.map(|x| x.default_sample_duration)
.unwrap_or(0)
}
}