diff options
author | metamuffin <metamuffin@disroot.org> | 2023-09-30 20:07:52 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-09-30 20:07:52 +0200 |
commit | 215503287d2e835f5ae9bd9cbd4262188025b44c (patch) | |
tree | ff96753bbd53a5886fa9859652f3231a6fff0b29 /stream/src/lib.rs | |
parent | b15fb338de55df177948a7fdf9704efa4374816b (diff) | |
download | jellything-215503287d2e835f5ae9bd9cbd4262188025b44c.tar jellything-215503287d2e835f5ae9bd9cbd4262188025b44c.tar.bz2 jellything-215503287d2e835f5ae9bd9cbd4262188025b44c.tar.zst |
broken snippet generation and outputting something that looks like hls
Diffstat (limited to 'stream/src/lib.rs')
-rw-r--r-- | stream/src/lib.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/stream/src/lib.rs b/stream/src/lib.rs index 726f1e8..be1ff32 100644 --- a/stream/src/lib.rs +++ b/stream/src/lib.rs @@ -7,12 +7,13 @@ pub mod hls; pub mod segment; use anyhow::{anyhow, bail, Context, Result}; +use hls::{hls_master_stream, hls_variant_stream}; use jellybase::CONF; use jellycommon::{ stream::{StreamFormat, StreamSpec}, LocalTrack, MediaSource, Node, }; -use segment::stream_segment; +use segment::segment_stream; use std::{io::SeekFrom, ops::Range}; use tokio::{ fs::File, @@ -31,7 +32,7 @@ pub fn stream_head(spec: &StreamSpec) -> StreamHead { match spec.format { StreamFormat::Original => StreamHead { content_type: "video/x-matroska", range_supported: true }, StreamFormat::Matroska => StreamHead { content_type: webm_or_mkv, range_supported: true }, - StreamFormat::Hls => StreamHead { content_type: "application/vnd.apple.mpegurl", range_supported: false }, + StreamFormat::HlsMaster | StreamFormat::HlsVariant => StreamHead { content_type: "application/vnd.apple.mpegurl", range_supported: false }, StreamFormat::Jhls => StreamHead { content_type: "application/jellything-jhls+json", range_supported: false }, StreamFormat::Segment => StreamHead { content_type: webm_or_mkv, range_supported: false }, } @@ -53,9 +54,10 @@ pub async fn stream(node: Node, spec: StreamSpec, range: Range<usize>) -> Result match spec.format { StreamFormat::Original => original_stream(track_sources, spec, range, b).await?, StreamFormat::Matroska => remux_stream(node, track_sources, spec, range, b).await?, - StreamFormat::Hls => bail!("unsupported"), + StreamFormat::HlsMaster => hls_master_stream(node, track_sources, spec, b).await?, + StreamFormat::HlsVariant => hls_variant_stream(node, track_sources, spec, b).await?, StreamFormat::Jhls => bail!("unsupported"), - StreamFormat::Segment => stream_segment(node, track_sources, spec, b).await?, + StreamFormat::Segment => segment_stream(node, track_sources, spec, b).await?, } Ok(a) |