diff options
author | metamuffin <metamuffin@disroot.org> | 2023-01-25 07:42:27 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-01-25 07:42:27 +0100 |
commit | 814896238c9b3928709f27606816ab6de60abdf3 (patch) | |
tree | 8134ed5213cf41f907f2af68ad9c8df245a937bd /matroska/src/read.rs | |
parent | 4529d07cc3f2f86a9dbb0d4802875a81d5c4c495 (diff) | |
download | jellything-814896238c9b3928709f27606816ab6de60abdf3.tar jellything-814896238c9b3928709f27606816ab6de60abdf3.tar.bz2 jellything-814896238c9b3928709f27606816ab6de60abdf3.tar.zst |
generate seek index
Diffstat (limited to 'matroska/src/read.rs')
-rw-r--r-- | matroska/src/read.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/matroska/src/read.rs b/matroska/src/read.rs index 1211351..c99f304 100644 --- a/matroska/src/read.rs +++ b/matroska/src/read.rs @@ -3,7 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2023 metamuffin <metamuffin.org> */ -use crate::{matroska::MatroskaTag, size::EbmlSize, Master}; +use crate::{matroska::MatroskaTag, size::EbmlSize, unflatten::IterWithPos, Master}; use anyhow::{anyhow, bail, Result}; use log::{debug, warn}; use std::{ @@ -159,9 +159,13 @@ impl EbmlReader { } } -impl Iterator for EbmlReader { +impl IterWithPos for EbmlReader { type Item = Result<MatroskaTag>; + fn position(&self) -> usize { + self.position + } + fn next(&mut self) -> Option<Self::Item> { if let Some(t) = self.queue.pop_front() { // match t { |