diff options
Diffstat (limited to 'ebml/src')
-rw-r--r-- | ebml/src/bin/experiment.rs | 9 | ||||
-rw-r--r-- | ebml/src/read.rs | 18 |
2 files changed, 3 insertions, 24 deletions
diff --git a/ebml/src/bin/experiment.rs b/ebml/src/bin/experiment.rs index 7195741..da7b175 100644 --- a/ebml/src/bin/experiment.rs +++ b/ebml/src/bin/experiment.rs @@ -20,13 +20,10 @@ fn main() -> anyhow::Result<()> { let tag = tag?; // println!("{} {tag:?}", r.position); match tag { - tag @ MatroskaTag::SeekHead(_) => { - eprintln!("{:?}", r.collect_master(tag)); - } - tag @ MatroskaTag::Cues(_) => { - eprintln!("{:?}", r.collect_master(tag)); - } tag => { + if MatroskaTag::is_master(tag.id())? { + eprintln!("{tag:?}"); + } w.write_tag(&tag)?; } } diff --git a/ebml/src/read.rs b/ebml/src/read.rs index eb1f365..133f2ae 100644 --- a/ebml/src/read.rs +++ b/ebml/src/read.rs @@ -80,7 +80,6 @@ impl EbmlReader { if self.position != end { warn!("we missed the end by {} bytes", self.position - end) } - eprintln!("closed (size): {:x}", e.id); self.stack.pop(); self.queue .push_back(MatroskaTag::construct_master(e.id, Master::End)?); @@ -106,7 +105,6 @@ impl EbmlReader { if valid_child { break; } else { - eprintln!("closed (automatic): {:x}", tag.id); self.queue.push_back(MatroskaTag::construct_master( self.stack.pop().unwrap().id, Master::End, @@ -143,22 +141,6 @@ impl EbmlReader { .collect(); Ok(()) } - - pub fn collect_master(&mut self, master: MatroskaTag) -> Result<Vec<MatroskaTag>> { - let end = MatroskaTag::construct_master(master.id(), Master::End)?; - eprintln!("start {master:?}"); - let mut out = vec![]; - while let Some(t) = self.next() { - let t = t?; - if t == end { - break; - } else { - out.push(t) - } - } - eprintln!("end {end:?} with {} els", out.len()); - Ok(out) - } } impl Iterator for EbmlReader { |