File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -373,8 +373,13 @@ where
373
373
String :: from_utf8 ( content) . map_err ( Into :: into)
374
374
}
375
375
376
- pub ( crate ) fn read_utf8 ( & mut self ) -> Result < String > {
377
- todo ! ( )
376
+ pub ( crate ) fn read_utf8 ( & mut self , element_length : u64 ) -> Result < String > {
377
+ // https://www.rfc-editor.org/rfc/rfc8794.html#section-7.5
378
+ // A UTF-8 Element MUST declare a length in octets from zero to VINTMAX
379
+
380
+ // Since the UTF-8 and String elements are both just turned into `String`s,
381
+ // we can just reuse the `read_string` method.
382
+ self . read_string ( element_length)
378
383
}
379
384
380
385
pub ( crate ) fn read_date ( & mut self ) -> Result < String > {
Original file line number Diff line number Diff line change 41
41
}
42
42
}
43
43
} ,
44
- ElementIdent :: MuxingApp => todo ! ( "Support segment.Info.MuxingApp" ) ,
45
- ElementIdent :: WritingApp => todo ! ( "Support segment.Info.WritingApp" ) ,
44
+ ElementIdent :: MuxingApp => {
45
+ properties. segment_info . muxing_app = element_reader. read_utf8 ( size) ?
46
+ } ,
47
+ ElementIdent :: WritingApp => {
48
+ properties. segment_info . writing_app = element_reader. read_utf8 ( size) ?
49
+ } ,
46
50
_ => {
47
51
// We do not end up using information from all of the segment
48
52
// elements, so we can just skip any useless ones.
You can’t perform that action at this time.
0 commit comments