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 /common | |
parent | 4529d07cc3f2f86a9dbb0d4802875a81d5c4c495 (diff) | |
download | jellything-814896238c9b3928709f27606816ab6de60abdf3.tar jellything-814896238c9b3928709f27606816ab6de60abdf3.tar.bz2 jellything-814896238c9b3928709f27606816ab6de60abdf3.tar.zst |
generate seek index
Diffstat (limited to 'common')
-rw-r--r-- | common/Cargo.toml | 1 | ||||
-rw-r--r-- | common/src/lib.rs | 18 |
2 files changed, 18 insertions, 1 deletions
diff --git a/common/Cargo.toml b/common/Cargo.toml index de089d6..0557282 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -5,3 +5,4 @@ edition = "2021" [dependencies] serde = { version = "1.0.152", features = ["derive"] } +bincode = { version = "2.0.0-rc.2", features = ["derive"] } diff --git a/common/src/lib.rs b/common/src/lib.rs index 0587613..08517c3 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,7 +1,11 @@ pub mod r#impl; +use bincode::{Decode, Encode}; use serde::{Deserialize, Serialize}; -use std::{collections::BTreeMap, path::PathBuf}; +use std::{ + collections::{BTreeMap, HashMap}, + path::PathBuf, +}; #[derive(Debug, Clone, Deserialize, Serialize)] pub struct DirectoryInfo { @@ -45,3 +49,15 @@ pub enum SourceTrackKind { }, Subtitles, } + +#[derive(Debug, Clone, Decode, Encode)] +pub struct SeekIndex { + pub blocks: Vec<BlockIndex>, +} + +#[derive(Debug, Clone, Decode, Encode)] +pub struct BlockIndex { + pub pts: u64, + pub source_off: usize, + pub size: usize, +} |