@@ -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
1919pub 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
2223pub 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 }
0 commit comments