mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2025-03-04 06:47:12 +00:00
EBML: Finish parsing segment.Info
Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
This commit is contained in:
parent
f418d342d9
commit
de3536c8ee
2 changed files with 13 additions and 4 deletions
|
@ -373,8 +373,13 @@ where
|
|||
String::from_utf8(content).map_err(Into::into)
|
||||
}
|
||||
|
||||
pub(crate) fn read_utf8(&mut self) -> Result<String> {
|
||||
todo!()
|
||||
pub(crate) fn read_utf8(&mut self, element_length: u64) -> Result<String> {
|
||||
// https://www.rfc-editor.org/rfc/rfc8794.html#section-7.5
|
||||
// A UTF-8 Element MUST declare a length in octets from zero to VINTMAX
|
||||
|
||||
// Since the UTF-8 and String elements are both just turned into `String`s,
|
||||
// we can just reuse the `read_string` method.
|
||||
self.read_string(element_length)
|
||||
}
|
||||
|
||||
pub(crate) fn read_date(&mut self) -> Result<String> {
|
||||
|
|
|
@ -41,8 +41,12 @@ where
|
|||
}
|
||||
}
|
||||
},
|
||||
ElementIdent::MuxingApp => todo!("Support segment.Info.MuxingApp"),
|
||||
ElementIdent::WritingApp => todo!("Support segment.Info.WritingApp"),
|
||||
ElementIdent::MuxingApp => {
|
||||
properties.segment_info.muxing_app = element_reader.read_utf8(size)?
|
||||
},
|
||||
ElementIdent::WritingApp => {
|
||||
properties.segment_info.writing_app = element_reader.read_utf8(size)?
|
||||
},
|
||||
_ => {
|
||||
// We do not end up using information from all of the segment
|
||||
// elements, so we can just skip any useless ones.
|
||||
|
|
Loading…
Add table
Reference in a new issue