File tree 2 files changed +16
-6
lines changed
2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -136,13 +136,13 @@ matroska_mapping_tables!(
136
136
const TAG_RETAINED : bool = true ;
137
137
const TAG_CONSUMED : bool = false ;
138
138
139
- pub ( super ) fn split_tag ( mut ebml_tag : MatroskaTag ) -> ( MatroskaTag , Tag ) {
139
+ pub ( super ) fn split_tag ( mut matroska_tag : MatroskaTag ) -> ( MatroskaTag , Tag ) {
140
140
let mut tag = Tag :: new ( TagType :: Matroska ) ;
141
141
142
142
// TODO: Pictures, can they be handled in a generic way?
143
143
// What about the uid and referral?
144
144
145
- ebml_tag . tags . retain_mut ( |t| {
145
+ matroska_tag . tags . retain_mut ( |t| {
146
146
let target_type = match & t. target {
147
147
Some ( t) if !t. has_uids ( ) => t. target_type ,
148
148
// We cannot use any tags bound to uids
@@ -159,7 +159,7 @@ pub(super) fn split_tag(mut ebml_tag: MatroskaTag) -> (MatroskaTag, Tag) {
159
159
return TAG_RETAINED ;
160
160
} ) ;
161
161
162
- ( ebml_tag , tag)
162
+ ( matroska_tag , tag)
163
163
}
164
164
165
165
fn split_simple_tags (
@@ -196,3 +196,7 @@ fn split_simple_tags(
196
196
197
197
return TAG_CONSUMED ;
198
198
}
199
+
200
+ pub ( super ) fn merge_tag ( tag : Tag , matroska_tag : MatroskaTag ) -> MatroskaTag {
201
+ todo ! ( )
202
+ }
Original file line number Diff line number Diff line change @@ -367,8 +367,8 @@ impl SplitTag for MatroskaTag {
367
367
impl MergeTag for SplitTagRemainder {
368
368
type Merged = MatroskaTag ;
369
369
370
- fn merge_tag ( self , _tag : crate :: tag:: Tag ) -> Self :: Merged {
371
- todo ! ( )
370
+ fn merge_tag ( self , tag : crate :: tag:: Tag ) -> Self :: Merged {
371
+ generic :: merge_tag ( tag , self . 0 )
372
372
}
373
373
}
374
374
@@ -385,7 +385,13 @@ impl From<MatroskaTag> for crate::tag::Tag {
385
385
}
386
386
387
387
impl From < crate :: tag:: Tag > for MatroskaTag {
388
- fn from ( input : crate :: tag:: Tag ) -> Self {
388
+ fn from ( mut input : crate :: tag:: Tag ) -> Self {
389
+ if unsafe { global_options ( ) . preserve_format_specific_items } {
390
+ if let Some ( companion) = input. companion_tag . take ( ) . and_then ( CompanionTag :: matroska) {
391
+ return SplitTagRemainder ( companion) . merge_tag ( input) ;
392
+ }
393
+ }
394
+
389
395
SplitTagRemainder :: default ( ) . merge_tag ( input)
390
396
}
391
397
}
You can’t perform that action at this time.
0 commit comments