mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-13 22:12:12 +00:00
craft-aaf: compare a re-written edit without its generated mob ids
`Composition::aaf_mob_id` is documented as a read identity: writers generate fresh format identifiers and never preserve it. The roundtrip test compared whole compositions after the second write, so it broke as soon as #1098 exposed the field. Compare them with the id cleared, as the surrounding comment already described.
This commit is contained in:
1 parent
e2dbb04aec
commit
c95885f6d9
1 file changed
+5
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
use craft_timeline::time::{FrameRate, Tick};
|
||||
|
||||
use crate::model::{CItem, CKind, CMarker, Document, Gain};
|
||||
use crate::model::{CItem, CKind, CMarker, Composition, Document, Gain};
|
||||
use crate::testdoc::{IDENTITY, pcm_ramp, picture_and_sound, sound_only};
|
||||
use crate::{Error, Report, aaf, omf};
|
||||
|
||||
@@ -90,9 +90,11 @@ fn aaf_round_trips_the_edit_at_every_rate() {
|
||||
let sound = back.sources.iter().find(|s| s.kind == CKind::Sound).unwrap();
|
||||
assert_eq!((sound.channels, sound.file_channels, sound.sample_rate, sound.bits), (2, 2, 48_000, 24), "{rate}");
|
||||
assert_eq!(sound.key, picture.key, "one media item");
|
||||
// what was read, written again, reads as the same edit (mob ids, and so source keys, are new)
|
||||
// what was read, written again, reads as the same edit (mob ids, and so source keys, are new;
|
||||
// a writer generates fresh format identifiers and never preserves `aaf_mob_id`)
|
||||
let again = read_clean(&aaf_bytes(&back, small), true);
|
||||
assert_eq!((shape(&again), &again.compositions), (shape(&back), &back.compositions), "{rate}");
|
||||
let no_ids = |c: &[Composition]| c.iter().cloned().map(|mut c| { c.aaf_mob_id = None; c }).collect::<Vec<_>>();
|
||||
assert_eq!((shape(&again), no_ids(&again.compositions)), (shape(&back), no_ids(&back.compositions)), "{rate}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user