EBML: Finish parsing segment.Info

Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
This commit is contained in:
Serial 2023-11-26 12:11:33 -05:00
parent f418d342d9
commit de3536c8ee
No known key found for this signature in database
GPG key ID: DA95198DC17C4568
2 changed files with 13 additions and 4 deletions

View file

@ -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> {

View file

@ -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.