aboutsummaryrefslogtreecommitdiff
path: root/stream
diff options
context:
space:
mode:
Diffstat (limited to 'stream')
-rw-r--r--stream/src/lib.rs10
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 {