mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-12 21:52:33 +00:00
EBML: Stub MergeTag impl
This commit is contained in:
parent
378595570c
commit
0dd9557447
2 changed files with 16 additions and 6 deletions
|
@ -136,13 +136,13 @@ matroska_mapping_tables!(
|
||||||
const TAG_RETAINED: bool = true;
|
const TAG_RETAINED: bool = true;
|
||||||
const TAG_CONSUMED: bool = false;
|
const TAG_CONSUMED: bool = false;
|
||||||
|
|
||||||
pub(super) fn split_tag(mut ebml_tag: MatroskaTag) -> (MatroskaTag, Tag) {
|
pub(super) fn split_tag(mut matroska_tag: MatroskaTag) -> (MatroskaTag, Tag) {
|
||||||
let mut tag = Tag::new(TagType::Matroska);
|
let mut tag = Tag::new(TagType::Matroska);
|
||||||
|
|
||||||
// TODO: Pictures, can they be handled in a generic way?
|
// TODO: Pictures, can they be handled in a generic way?
|
||||||
// What about the uid and referral?
|
// What about the uid and referral?
|
||||||
|
|
||||||
ebml_tag.tags.retain_mut(|t| {
|
matroska_tag.tags.retain_mut(|t| {
|
||||||
let target_type = match &t.target {
|
let target_type = match &t.target {
|
||||||
Some(t) if !t.has_uids() => t.target_type,
|
Some(t) if !t.has_uids() => t.target_type,
|
||||||
// We cannot use any tags bound to uids
|
// We cannot use any tags bound to uids
|
||||||
|
@ -159,7 +159,7 @@ pub(super) fn split_tag(mut ebml_tag: MatroskaTag) -> (MatroskaTag, Tag) {
|
||||||
return TAG_RETAINED;
|
return TAG_RETAINED;
|
||||||
});
|
});
|
||||||
|
|
||||||
(ebml_tag, tag)
|
(matroska_tag, tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn split_simple_tags(
|
fn split_simple_tags(
|
||||||
|
@ -196,3 +196,7 @@ fn split_simple_tags(
|
||||||
|
|
||||||
return TAG_CONSUMED;
|
return TAG_CONSUMED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(super) fn merge_tag(tag: Tag, matroska_tag: MatroskaTag) -> MatroskaTag {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
|
|
@ -367,8 +367,8 @@ impl SplitTag for MatroskaTag {
|
||||||
impl MergeTag for SplitTagRemainder {
|
impl MergeTag for SplitTagRemainder {
|
||||||
type Merged = MatroskaTag;
|
type Merged = MatroskaTag;
|
||||||
|
|
||||||
fn merge_tag(self, _tag: crate::tag::Tag) -> Self::Merged {
|
fn merge_tag(self, tag: crate::tag::Tag) -> Self::Merged {
|
||||||
todo!()
|
generic::merge_tag(tag, self.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,7 +385,13 @@ impl From<MatroskaTag> for crate::tag::Tag {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<crate::tag::Tag> for MatroskaTag {
|
impl From<crate::tag::Tag> for MatroskaTag {
|
||||||
fn from(input: crate::tag::Tag) -> Self {
|
fn from(mut input: crate::tag::Tag) -> Self {
|
||||||
|
if unsafe { global_options().preserve_format_specific_items } {
|
||||||
|
if let Some(companion) = input.companion_tag.take().and_then(CompanionTag::matroska) {
|
||||||
|
return SplitTagRemainder(companion).merge_tag(input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SplitTagRemainder::default().merge_tag(input)
|
SplitTagRemainder::default().merge_tag(input)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue