-
Notifications
You must be signed in to change notification settings - Fork 86
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
fix "mdat size too large" #80
Conversation
I can't reproduce the cargo clippy error under rustc 1.62.1 : ~/dev/rust/mp4-rust$ cargo clippy --no-deps -- -D warnings but failed under rustc 1.63.0: error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving error: you are deriving |
Thanks! Sorry for the late response! |
* fix "mdat size too large" * fix clippy * Fix clippy::derive-partial-eq-without-eq
use 'wide' atom as a place holder to solve "mdat size too large" issue in writer.rs.
"Extended Size
If the size field of an atom is set to 1, the type field is followed by a 64-bit extended size field, which contains the actual size of the atom as a 64-bit unsigned integer. This is used when the size of a media data atom exceeds 2^32 bytes.
When the size field contains the actual size of the atom, the extended size field is not present. This means that when a QuickTime atom is modified by adding data, and its size crosses the 2^32 byte limit, there is no extended size field in which to record the new atom size. Consequently, it is not always possible to enlarge an atom beyond 2^32 bytes without copying its contents to a new atom.
To prevent this inconvenience, media data atoms are typically created with a 64-bit placeholder atom immediately preceding them in the movie file. The placeholder atom has a type of kWideAtomPlaceholderType ('wide').
Much like a 'free' or 'skip' atom, the 'wide' atom is reserved space, but in this case the space is reserved for a specific purpose. If a 'wide' atom immediately precedes a second atom, the second atom can be extended from a 32-bit size to a 64-bit size simply by starting the atom header 8 bytes earlier (overwriting the 'wide' atom), setting the size field to 1, and adding an extended size field. This way the offsets for sample data do not need to be recalculated.
The 'wide' atom is exactly 8 bytes in size, and consists solely of its size and type fields. It contains no other data."
---- https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap1/qtff1.html#//apple_ref/doc/uid/TP40000939-CH203-BBCGDDDF