Skip to content

Commit fe799ee

Browse files
committed
fix warn
1 parent d6ddd2f commit fe799ee

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

backend/src/decoder.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ use crate::{
1414
ffmpeg::{bin::ffmpeg_path, hw_decoder, probe_video_fps},
1515
future::SharedManualFuture,
1616
};
17-
use tracing::{warn};
17+
use tracing::warn;
1818

1919
pub static DECODER: LazyLock<Decoder> = LazyLock::new(|| Decoder::new());
20-
static FPS_CACHE: LazyLock<Mutex<HashMap<String, f64>>> = LazyLock::new(|| Mutex::new(HashMap::new()));
20+
static FPS_CACHE: LazyLock<Mutex<HashMap<String, f64>>> =
21+
LazyLock::new(|| Mutex::new(HashMap::new()));
2122

2223
pub struct Decoder {
2324
map: Mutex<HashMap<DecoderKey, CachedDecoder>>,
@@ -300,11 +301,7 @@ impl CachedDecoder {
300301
}
301302

302303
fn ensure_stream_task(&self) {
303-
if self
304-
.inner
305-
.stream_running
306-
.swap(true, Ordering::Relaxed)
307-
{
304+
if self.inner.stream_running.swap(true, Ordering::Relaxed) {
308305
return;
309306
}
310307

@@ -405,8 +402,7 @@ impl FrameStream {
405402
if backoff > 0.0 {
406403
cmd.arg("-ss").arg(format!("{:.6}", backoff));
407404
}
408-
cmd
409-
.arg("-vf")
405+
cmd.arg("-vf")
410406
.arg(filter)
411407
.arg("-an")
412408
.arg("-vsync")
@@ -480,13 +476,6 @@ async fn run_stream_loop(inner: Arc<Inner>) {
480476
};
481477

482478
if restart {
483-
let reason = if stream.is_none() {
484-
"init"
485-
} else if target_frame < current_frame {
486-
"backward"
487-
} else {
488-
"gap"
489-
};
490479
if let Some(mut old) = stream.take() {
491480
old.shutdown().await;
492481
}

backend/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ async fn file_handler(
400400
Ok(value) => value,
401401
Err(_) => return Ok(cors_status(StatusCode::BAD_REQUEST)),
402402
};
403-
let mut file = match tokio::fs::File::open(&resolved_path).await {
403+
let file = match tokio::fs::File::open(&resolved_path).await {
404404
Ok(value) => value,
405405
Err(_) => return Ok(cors_status(StatusCode::NOT_FOUND)),
406406
};

0 commit comments

Comments
 (0)