diff options
Diffstat (limited to 'matroska/src/bin')
-rw-r--r-- | matroska/src/bin/experiment.rs | 33 | ||||
-rw-r--r-- | matroska/src/bin/mkvdump.rs | 8 |
2 files changed, 3 insertions, 38 deletions
diff --git a/matroska/src/bin/experiment.rs b/matroska/src/bin/experiment.rs deleted file mode 100644 index e185787..0000000 --- a/matroska/src/bin/experiment.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* - This file is part of jellything (https://codeberg.org/metamuffin/jellything) - which is licensed under the GNU Affero General Public License (version 3); see /COPYING. - Copyright (C) 2024 metamuffin <metamuffin.org> -*/ -use jellymatroska::{ - matroska::MatroskaTag, read::EbmlReader, unflatten::IterWithPos, write::EbmlWriter, -}; -use std::{ - fs::File, - io::{stdout, BufReader, BufWriter}, -}; - -fn main() { - env_logger::init_from_env("LOG"); - let path = std::env::args().nth(1).unwrap(); - let mut r = EbmlReader::new(BufReader::new(File::open(path).unwrap())); - let mut w = EbmlWriter::new(BufWriter::new(stdout()), 0); - - // r.seek( - // 631147167 + 52, - // ebml::matroska::MatroskaTag::Cues(Master::Start), - // ) - // .unwrap(); - - while let Some(tag) = r.next() { - let tag = tag.unwrap(); - if MatroskaTag::is_master(tag.id()).unwrap() { - eprintln!("{tag:?}"); - } - w.write_tag(&tag).unwrap(); - } -} diff --git a/matroska/src/bin/mkvdump.rs b/matroska/src/bin/mkvdump.rs index 9e35716..27b4849 100644 --- a/matroska/src/bin/mkvdump.rs +++ b/matroska/src/bin/mkvdump.rs @@ -3,9 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2024 metamuffin <metamuffin.org> */ -use jellymatroska::{ - block::Block, matroska::MatroskaTag, read::EbmlReader, unflatten::IterWithPos, -}; +use jellymatroska::{block::Block, matroska::MatroskaTag, read::EbmlReader}; use std::{fs::File, io::BufReader}; fn main() { @@ -14,13 +12,13 @@ fn main() { let mut r = EbmlReader::new(BufReader::new(File::open(path).unwrap())); while let Some(tag) = r.next() { - let tag = tag.unwrap(); + let (position, tag) = tag.unwrap(); match tag { MatroskaTag::SimpleBlock(b) | MatroskaTag::Block(b) => { let b = Block::parse(&b).unwrap(); println!("block kf={} ts_off={}", b.keyframe, b.timestamp_off) } - _ => println!("{} {tag:?}", r.position), + _ => println!("{} {tag:?}", position.unwrap_or(0)), } } } |