diff options
author | metamuffin <metamuffin@disroot.org> | 2025-04-30 10:47:54 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-04-30 10:47:54 +0200 |
commit | a2ef3f6ec4c830611fde1a2e935588ccbbc61c03 (patch) | |
tree | ddcc1cb501e6c7237edd491aa7136d02150d03d3 /stream | |
parent | 212a0f23bc894faf88e159560c113f504349cc05 (diff) | |
download | jellything-a2ef3f6ec4c830611fde1a2e935588ccbbc61c03.tar jellything-a2ef3f6ec4c830611fde1a2e935588ccbbc61c03.tar.bz2 jellything-a2ef3f6ec4c830611fde1a2e935588ccbbc61c03.tar.zst |
config works
Diffstat (limited to 'stream')
-rw-r--r-- | stream/src/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/stream/src/lib.rs b/stream/src/lib.rs index ccc5cb9..8352eaf 100644 --- a/stream/src/lib.rs +++ b/stream/src/lib.rs @@ -24,13 +24,12 @@ use std::{ io::SeekFrom, ops::Range, path::PathBuf, - sync::{Arc, LazyLock}, + sync::{Arc, LazyLock, Mutex}, }; use stream_info::{stream_info, write_stream_info}; use tokio::{ fs::File, io::{duplex, AsyncReadExt, AsyncSeekExt, AsyncWriteExt, DuplexStream}, - sync::Mutex, }; #[rustfmt::skip] @@ -43,13 +42,14 @@ pub struct Config { #[serde(default)] pub offer_av1: bool, } +pub static CONF_PRELOAD: Mutex<Option<Config>> = Mutex::new(None); static CONF: LazyLock<Config> = LazyLock::new(|| { CONF_PRELOAD - .blocking_lock() + .lock() + .unwrap() .take() - .expect("cache config not preloaded. logic error") + .expect("stream config not preloaded. logic error") }); -static CONF_PRELOAD: Mutex<Option<Config>> = Mutex::const_new(None); #[derive(Debug)] pub struct SMediaInfo { |