aboutsummaryrefslogtreecommitdiff
path: root/transcoder
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-02-19 18:06:09 +0100
committermetamuffin <metamuffin@disroot.org>2026-02-19 18:06:09 +0100
commitc545bdbc10ae5a55f991e03260e6a74b92a75fda (patch)
treeca2504648aead2c52ec7e5429d814174e7bc3124 /transcoder
parente409abe9a4a8b2553d1746c65631b84fdeff7d77 (diff)
downloadjellything-c545bdbc10ae5a55f991e03260e6a74b92a75fda.tar
jellything-c545bdbc10ae5a55f991e03260e6a74b92a75fda.tar.bz2
jellything-c545bdbc10ae5a55f991e03260e6a74b92a75fda.tar.zst
migrate transcoder config
Diffstat (limited to 'transcoder')
-rw-r--r--transcoder/src/fragment.rs5
-rw-r--r--transcoder/src/lib.rs11
2 files changed, 4 insertions, 12 deletions
diff --git a/transcoder/src/fragment.rs b/transcoder/src/fragment.rs
index 6603afa..85abbd5 100644
--- a/transcoder/src/fragment.rs
+++ b/transcoder/src/fragment.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, Config, LOCAL_VIDEO_TRANSCODING_TASKS};
+use crate::{Config, LOCAL_VIDEO_TRANSCODING_TASKS};
use anyhow::Result;
use jellycache::{Cache, HashKey};
use jellyremuxer::{ContainerFormat, demuxers::create_demuxer, muxers::write_fragment};
@@ -22,6 +22,7 @@ use winter_matroska::{Cluster, Segment, TrackEntry as MatroskaTrackEntry, block:
pub fn transcode(
cache: &Cache,
+ config: &Config,
kind: TrackKind,
input_key: &str,
output_format: &StreamFormatInfo,
@@ -32,7 +33,7 @@ pub fn transcode(
kind,
&input.tracks.as_ref().unwrap().entries[0],
output_format,
- &CONF,
+ config,
)
.unwrap();
diff --git a/transcoder/src/lib.rs b/transcoder/src/lib.rs
index 50e445c..0b39b51 100644
--- a/transcoder/src/lib.rs
+++ b/transcoder/src/lib.rs
@@ -6,7 +6,7 @@
#![feature(exit_status_error)]
use serde::{Deserialize, Serialize};
-use std::sync::{LazyLock, Mutex};
+use std::sync::Mutex;
pub mod fragment;
pub mod image;
@@ -26,13 +26,4 @@ pub struct Config {
pub x264_preset: Option<String>,
}
-pub static CONF_PRELOAD: Mutex<Option<Config>> = Mutex::new(None);
-static CONF: LazyLock<Config> = LazyLock::new(|| {
- CONF_PRELOAD
- .lock()
- .unwrap()
- .take()
- .expect("transcoder config not preloaded. logic error")
-});
-
static LOCAL_VIDEO_TRANSCODING_TASKS: Mutex<()> = Mutex::new(());