aboutsummaryrefslogtreecommitdiff
path: root/remuxer/src/segment_extractor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'remuxer/src/segment_extractor.rs')
-rw-r--r--remuxer/src/segment_extractor.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/remuxer/src/segment_extractor.rs b/remuxer/src/segment_extractor.rs
index 095bdfe..c44a511 100644
--- a/remuxer/src/segment_extractor.rs
+++ b/remuxer/src/segment_extractor.rs
@@ -1,24 +1,22 @@
-use anyhow::{anyhow, Result};
+use anyhow::{anyhow, bail, Result};
use jellymatroska::{block::Block, read::EbmlReader, unflatten::IterWithPos, MatroskaTag};
use log::{debug, trace};
-use std::collections::VecDeque;
-pub struct AbsoluteBlock {
- pub pts_base: u64,
- pub inner: Block,
-}
+// pub struct AbsoluteBlock {
+// pub pts_base: u64,
+// pub inner: Block,
+// }
+// impl AbsoluteBlock {
+// pub fn pts(&self) -> u64 {
+// self.inner.timestamp_off as u64 + self.pts_base
+// }
+// }
pub struct SegmentExtractIter<'a> {
segment: &'a mut EbmlReader,
extract: u64,
}
-impl AbsoluteBlock {
- pub fn pts(&self) -> u64 {
- self.inner.timestamp_off as u64 + self.pts_base
- }
-}
-
impl<'a> SegmentExtractIter<'a> {
pub fn new(segment: &'a mut EbmlReader, extract: u64) -> Self {
Self { segment, extract }
@@ -31,6 +29,7 @@ impl<'a> SegmentExtractIter<'a> {
MatroskaTag::Void(_) => (),
MatroskaTag::Crc32(_) => (),
MatroskaTag::Cluster(_) => (),
+ MatroskaTag::Timestamp(_) => (),
MatroskaTag::SimpleBlock(buf) | MatroskaTag::Block(buf) => {
let block = Block::parse(&buf)?;
if block.track == self.extract {
@@ -38,6 +37,7 @@ impl<'a> SegmentExtractIter<'a> {
return Ok(block);
}
}
+ MatroskaTag::Cues(_) => bail!("reached cues, this is the end"),
_ => debug!("(rs) tag ignored: {item:?}"),
}
}