aboutsummaryrefslogtreecommitdiff
path: root/stream
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-10-01 16:02:41 +0200
committermetamuffin <metamuffin@disroot.org>2023-10-01 16:02:41 +0200
commit3c1c3325ecebd6f5c7bc33a107c6efc4cda8b3ea (patch)
tree895ea285ebc52bb4e0e044d044d466f8e41ef599 /stream
parent9559da7f56310e8b40e1bce0b073147b99301008 (diff)
downloadjellything-3c1c3325ecebd6f5c7bc33a107c6efc4cda8b3ea.tar
jellything-3c1c3325ecebd6f5c7bc33a107c6efc4cda8b3ea.tar.bz2
jellything-3c1c3325ecebd6f5c7bc33a107c6efc4cda8b3ea.tar.zst
jhls does not work bc segments to short
Diffstat (limited to 'stream')
-rw-r--r--stream/src/jhls.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/stream/src/jhls.rs b/stream/src/jhls.rs
index 5e15d6f..4488dac 100644
--- a/stream/src/jhls.rs
+++ b/stream/src/jhls.rs
@@ -13,11 +13,9 @@ pub async fn jhls_stream(
_spec: StreamSpec,
mut b: DuplexStream,
) -> Result<()> {
+ let media = node.public.media.clone().unwrap();
let tracks = tokio::task::spawn_blocking(move || {
- node.public
- .media
- .as_ref()
- .unwrap()
+ media
.tracks
.iter()
.enumerate()
@@ -37,7 +35,10 @@ pub async fn jhls_stream(
})
.await??;
- let out = serde_json::to_string(&JhlsMetadata { tracks })?;
+ let out = serde_json::to_string(&JhlsMetadata {
+ tracks,
+ duration: media.duration,
+ })?;
tokio::spawn(async move { b.write_all(out.as_bytes()).await });
Ok(())
}