diff options
author | metamuffin <metamuffin@disroot.org> | 2023-10-02 15:07:16 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-10-02 15:07:16 +0200 |
commit | ab7d91489b0ba4c9222f493857c98aa4331a982b (patch) | |
tree | be5d3c2d3a560630efd8ca467ed9f2107e5f6410 /stream/src/segment.rs | |
parent | 546d75a1d39f8bdef6a1d8dffec59760bfecb3b2 (diff) | |
download | jellything-ab7d91489b0ba4c9222f493857c98aa4331a982b.tar jellything-ab7d91489b0ba4c9222f493857c98aa4331a982b.tar.bz2 jellything-ab7d91489b0ba4c9222f493857c98aa4331a982b.tar.zst |
width steps
Diffstat (limited to 'stream/src/segment.rs')
-rw-r--r-- | stream/src/segment.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/stream/src/segment.rs b/stream/src/segment.rs index 08d3efa..fdef01c 100644 --- a/stream/src/segment.rs +++ b/stream/src/segment.rs @@ -24,6 +24,7 @@ pub async fn segment_stream( let n = spec.index.ok_or(anyhow!("segment index missing"))?; if let Some(width) = spec.width { + let width = width_steps(width); let location = transcode( "", Encoding::Video { @@ -74,3 +75,11 @@ pub async fn segment_stream( Ok(()) } + +fn width_steps(width: usize) -> usize { + match width { + x if x >= 3840 => 3840, + x if x >= 1920 => 1920, + _ => 720, + } +} |