diff options
author | metamuffin <metamuffin@disroot.org> | 2023-09-30 09:44:23 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-09-30 09:44:23 +0200 |
commit | 9e205e33a61d0268c35362740aa91ca459dbf428 (patch) | |
tree | 2277d78a5215c9da5c8090b988c0e9d595cbda96 /common | |
parent | c180123e07c31ff45194e1645a4b90c3fd039650 (diff) | |
download | jellything-9e205e33a61d0268c35362740aa91ca459dbf428.tar jellything-9e205e33a61d0268c35362740aa91ca459dbf428.tar.bz2 jellything-9e205e33a61d0268c35362740aa91ca459dbf428.tar.zst |
stream head + webm not a format anymore
Diffstat (limited to 'common')
-rw-r--r-- | common/src/stream.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/common/src/stream.rs b/common/src/stream.rs index 3fb1008..ca09999 100644 --- a/common/src/stream.rs +++ b/common/src/stream.rs @@ -7,6 +7,7 @@ use serde::{Deserialize, Serialize}; pub struct StreamSpec { pub tracks: Vec<usize>, pub format: StreamFormat, + pub webm: Option<bool>, pub abr: Option<usize>, pub vbr: Option<usize>, pub index: Option<usize>, @@ -19,7 +20,6 @@ pub struct StreamSpec { pub enum StreamFormat { #[cfg_attr(feature = "rocket", field(value = "original"))] Original, #[cfg_attr(feature = "rocket", field(value = "matroska"))] Matroska, - #[cfg_attr(feature = "rocket", field(value = "webm"))] Webm, #[cfg_attr(feature = "rocket", field(value = "hls"))] Hls, #[cfg_attr(feature = "rocket", field(value = "jhls"))] Jhls, #[cfg_attr(feature = "rocket", field(value = "hlsseg"))] Segment, @@ -28,11 +28,12 @@ pub enum StreamFormat { impl Default for StreamSpec { fn default() -> Self { Self { - tracks: Default::default(), - format: StreamFormat::Webm, - abr: Default::default(), - vbr: Default::default(), - index: Default::default(), + tracks: Vec::new(), + format: StreamFormat::Matroska, + webm: Some(true), + abr: None, + vbr: None, + index: None, } } } @@ -64,6 +65,9 @@ impl StreamSpec { if let Some(index) = self.index { writeln!(u, "&index={index}").unwrap(); } + if let Some(webm) = self.webm { + writeln!(u, "&webmm={webm}").unwrap(); + } u } } @@ -73,7 +77,6 @@ impl StreamFormat { match self { StreamFormat::Original => "original", StreamFormat::Matroska => "matroska", - StreamFormat::Webm => "webm", StreamFormat::Hls => "hls", StreamFormat::Jhls => "jhls", StreamFormat::Segment => "hlsseg", |