diff options
Diffstat (limited to 'remuxer/src/import')
| -rw-r--r-- | remuxer/src/import/mod.rs | 28 | 
1 files changed, 19 insertions, 9 deletions
| diff --git a/remuxer/src/import/mod.rs b/remuxer/src/import/mod.rs index b57db15..886c5f1 100644 --- a/remuxer/src/import/mod.rs +++ b/remuxer/src/import/mod.rs @@ -26,7 +26,10 @@ pub fn import_read(path: &PathBuf, input: &mut EbmlReader, iteminfo: &mut ItemIn          match item {              MatroskaTag::Ebml(_) => {                  let mut iter = Unflatten::new_with_end(input, item); -                while let Some(Ok(Unflat { children: _, item })) = iter.n() { +                while let Some(Ok(Unflat { +                    children: _, item, .. +                })) = iter.n() +                {                      match item {                          MatroskaTag::DocType(t) => {                              if !matches!(t.as_str(), "matroska" | "webm") { @@ -58,12 +61,15 @@ fn import_read_segment(      let (mut timestamp_scale, mut duration) = (None, None);      let mut seek_index = HashMap::new(); -    while let Some(Ok(Unflat { children, item })) = segment.n() { +    while let Some(Ok(Unflat { children, item, .. })) = segment.n() {          match item {              MatroskaTag::SeekHead(_) => {}              MatroskaTag::Info(_) => {                  let mut children = children.unwrap(); -                while let Some(Ok(Unflat { children: _, item })) = children.n() { +                while let Some(Ok(Unflat { +                    children: _, item, .. +                })) = children.n() +                {                      match item {                          MatroskaTag::TimestampScale(v) => timestamp_scale = Some(v),                          MatroskaTag::Duration(v) => duration = Some(v), @@ -76,7 +82,7 @@ fn import_read_segment(              MatroskaTag::Chapters(_) => {}              MatroskaTag::Tracks(_) => {                  let mut children = children.unwrap(); -                while let Some(Ok(Unflat { children, item })) = children.n() { +                while let Some(Ok(Unflat { children, item, .. })) = children.n() {                      match item {                          MatroskaTag::TrackEntry(_) => {                              let mut children = children.unwrap(); @@ -98,7 +104,7 @@ fn import_read_segment(                                  None, None, None, None, None, None, None, None, None, None, None,                                  None, None,                              ); -                            while let Some(Ok(Unflat { children, item })) = children.n() { +                            while let Some(Ok(Unflat { children, item, .. })) = children.n() {                                  match item {                                      MatroskaTag::CodecID(b) => codec = Some(b),                                      MatroskaTag::Language(v) => language = Some(v), @@ -176,14 +182,19 @@ fn import_read_segment(                  let mut position = children.position();                  loop { -                    if let Some(Ok(Unflat { children, item })) = children.n() { +                    if let Some(Ok(Unflat { children, item, .. })) = children.n() {                          match item {                              MatroskaTag::Timestamp(ts) => pts = ts,                              MatroskaTag::BlockGroup(_) => {                                  debug!("group");                                  let mut children = children.unwrap(); -                                let position = children.position(); //? TODO where should this point to? cluster or block? -                                while let Some(Ok(Unflat { children: _, item })) = children.n() { +                                // let position = children.position(); //? TODO where should this point to? cluster or block? // probably block +                                while let Some(Ok(Unflat { +                                    children: _, +                                    item, +                                    position, +                                })) = children.n() +                                {                                      match item {                                          MatroskaTag::Block(ref buf) => {                                              let block = Block::parse(buf)?; @@ -230,7 +241,6 @@ fn import_read_segment(                      position = children.position();                  }              } -              _ => debug!("(rs) tag ignored: {item:?}"),          };      } | 
