diff options
Diffstat (limited to 'stream/src/stream_info.rs')
| -rw-r--r-- | stream/src/stream_info.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/stream/src/stream_info.rs b/stream/src/stream_info.rs index 33dd288..694a44f 100644 --- a/stream/src/stream_info.rs +++ b/stream/src/stream_info.rs @@ -3,7 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2026 metamuffin <metamuffin.org> */ -use crate::{CONF, SMediaInfo, cues::generate_cues, metadata::read_metadata}; +use crate::{Config, SMediaInfo, cues::generate_cues, metadata::read_metadata}; use anyhow::Result; use jellyremuxer::matroska::{self, Segment, TrackEntry, TrackType}; use jellystream_types::{ @@ -47,7 +47,7 @@ pub(crate) fn stream_info(info: &SMediaInfo) -> Result<(InternalStreamInfo, Stre matroska::TrackType::Subtitle => TrackKind::Subtitle, _ => todo!(), }, - formats: stream_formats(t, byterate * 8.), + formats: stream_formats(&info.config, t, byterate * 8.), }); track_to_file.push((i, t.track_number)); } @@ -71,7 +71,7 @@ pub(crate) fn stream_info(info: &SMediaInfo) -> Result<(InternalStreamInfo, Stre )) } -fn stream_formats(t: &TrackEntry, remux_bitrate: f64) -> Vec<StreamFormatInfo> { +fn stream_formats(config: &Config, t: &TrackEntry, remux_bitrate: f64) -> Vec<StreamFormatInfo> { let mut formats = Vec::new(); formats.push(StreamFormatInfo { codec: t.codec_id.to_string(), @@ -103,11 +103,11 @@ fn stream_formats(t: &TrackEntry, remux_bitrate: f64) -> Vec<StreamFormatInfo> { // most codecs use chroma subsampling that requires even dims let h = ((w * sh) / sw) & !1; // clear last bit to ensure even height. for (cid, enable) in [ - ("V_AV1", CONF.offer_av1), - ("V_VP8", CONF.offer_vp8), - ("V_VP9", CONF.offer_vp9), - ("V_MPEG4/ISO/AVC", CONF.offer_avc), - ("V_MPEGH/ISO/HEVC", CONF.offer_hevc), + ("V_AV1", config.offer_av1), + ("V_VP8", config.offer_vp8), + ("V_VP9", config.offer_vp9), + ("V_MPEG4/ISO/AVC", config.offer_avc), + ("V_MPEGH/ISO/HEVC", config.offer_hevc), ] { if enable { formats.push(StreamFormatInfo { |