You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the spec says that the hdlr box should be the first one, not all
implementations follow that. Actually look over all boxes in Meta to
find Hdlr.
Also add a test for such weirdly-formatted box
Change the way unknown MetaBox is stored: store a list of boxes instead
of raw bytes
let data = b"\x00\x00\x00\x7fmeta\x00\x00\x00\x00\x00\x00\x00Qilst\x00\x00\x00I\xa9too\x00\x00\x00Adata\x00\x00\x00\x01\x00\x00\x00\x00TMPGEnc Video Mastering Works 7 Version 7.0.15.17\x00\x00\x00\"hdlr\x00\x00\x00\x00\x00\x00\x00\x00mdirappl\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
262
+
letmut reader = Cursor::new(data);
263
+
let header = BoxHeader::read(&mut reader).unwrap();
264
+
assert_eq!(header.name,BoxType::MetaBox);
265
+
266
+
let meta_box = MetaBox::read_box(&mut reader, header.size).unwrap();
267
+
268
+
// this contains \xa9too box in the ilst
269
+
// it designates the tool that created the file, but is not yet supported by this crate
270
+
assert_eq!(
271
+
meta_box,
272
+
MetaBox::Mdir{
273
+
ilst:Some(IlstBox::default())
274
+
}
275
+
);
276
+
}
277
+
205
278
#[test]
206
279
fntest_meta_unknown(){
207
280
let src_hdlr = HdlrBox{
208
281
handler_type:FourCC::from(*b"test"),
209
282
..Default::default()
210
283
};
211
-
let src_data = b"123";
284
+
let src_data = (BoxType::UnknownBox(0x42494241),b"123".to_vec());
0 commit comments