diff --git a/Cargo.lock b/Cargo.lock index 9739e0ba..a840f695 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -519,7 +519,7 @@ dependencies = [ "futures-lite 2.3.0", "parking", "polling 3.6.0", - "rustix 0.38.32", + "rustix 0.38.33", "slab", "tracing", "windows-sys 0.52.0", @@ -2519,7 +2519,7 @@ dependencies = [ "concurrent-queue", "hermit-abi", "pin-project-lite", - "rustix 0.38.32", + "rustix 0.38.33", "tracing", "windows-sys 0.52.0", ] @@ -2804,9 +2804,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "e3cc72858054fcff6d7dea32df2aeaee6a7c24227366d7ea429aada2f26b16ad" dependencies = [ "bitflags 2.5.0", "errno", @@ -2896,12 +2896,27 @@ dependencies = [ "regex", ] +[[package]] +name = "scc" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec96560eea317a9cc4e0bb1f6a2c93c09a19b8c4fc5cb3fcc0ec1c094cd783e2" +dependencies = [ + "sdd", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sdd" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b84345e4c9bd703274a082fb80caaa99b7612be48dfaa1dd9266577ec412309d" + [[package]] name = "semver" version = "1.0.22" @@ -2975,23 +2990,23 @@ dependencies = [ [[package]] name = "serial_test" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ad9342b3aaca7cb43c45c097dd008d4907070394bd0751a0aa8817e5a018d" +checksum = "adb86f9315df5df6a70eae0cc22395a44e544a0d8897586820770a35ede74449" dependencies = [ - "dashmap", "futures", - "lazy_static", "log", + "once_cell", "parking_lot", + "scc", "serial_test_derive", ] [[package]] name = "serial_test_derive" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" +checksum = "a9bb72430492e9549b0c4596725c0f82729bff861c45aa8099c0a8e67fc3b721" dependencies = [ "proc-macro2", "quote", @@ -3034,9 +3049,9 @@ checksum = "b2a4eed4c5ae38438470ab8e0108bb751012f786f44ff585cfd837c9a5fe426f" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -3443,7 +3458,7 @@ checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand 2.0.2", - "rustix 0.38.32", + "rustix 0.38.33", "windows-sys 0.52.0", ] diff --git a/lib/src/utils/advanced_config.rs b/lib/src/utils/advanced_config.rs index f60481c0..ad81991c 100644 --- a/lib/src/utils/advanced_config.rs +++ b/lib/src/utils/advanced_config.rs @@ -66,7 +66,7 @@ impl AdvancedConfig { pub fn new(cfg_path: PathBuf) -> Self { let mut config: AdvancedConfig = Default::default(); - if let Ok(f) = File::open(&cfg_path) { + if let Ok(f) = File::open(cfg_path) { config = match serde_yaml::from_reader(f) { Ok(yaml) => yaml, Err(_) => AdvancedConfig::default(), diff --git a/tests/src/engine_cmd.rs b/tests/src/engine_cmd.rs index 07d25576..582fa38f 100644 --- a/tests/src/engine_cmd.rs +++ b/tests/src/engine_cmd.rs @@ -8,7 +8,7 @@ use ffplayout_lib::{ #[test] fn video_audio_input() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = Stream; @@ -37,7 +37,7 @@ fn video_audio_input() { #[test] fn video_audio_custom_filter1_input() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = Stream; @@ -64,7 +64,7 @@ fn video_audio_custom_filter1_input() { #[test] fn video_audio_custom_filter2_input() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = Stream; @@ -93,7 +93,7 @@ fn video_audio_custom_filter2_input() { #[test] fn video_audio_custom_filter3_input() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = Stream; @@ -121,7 +121,7 @@ fn video_audio_custom_filter3_input() { #[test] fn dual_audio_aevalsrc_input() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = Stream; @@ -149,7 +149,7 @@ fn dual_audio_aevalsrc_input() { #[test] fn dual_audio_input() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = Stream; @@ -176,7 +176,7 @@ fn dual_audio_input() { #[test] fn video_separate_audio_input() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = Stream; @@ -213,7 +213,7 @@ fn video_separate_audio_input() { #[test] fn video_audio_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.out.output_cmd = Some(vec_strings![ @@ -272,7 +272,7 @@ fn video_audio_stream() { #[test] fn video_audio_filter1_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.text.add_text = false; @@ -347,7 +347,7 @@ fn video_audio_filter1_stream() { #[test] fn video_audio_filter2_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.text.add_text = true; @@ -430,7 +430,7 @@ fn video_audio_filter2_stream() { #[test] fn video_audio_filter3_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.text.add_text = true; @@ -516,7 +516,7 @@ fn video_audio_filter3_stream() { #[test] fn video_audio_filter4_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.text.add_text = true; @@ -602,7 +602,7 @@ fn video_audio_filter4_stream() { #[test] fn video_dual_audio_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.processing.audio_tracks = 2; @@ -673,7 +673,7 @@ fn video_dual_audio_stream() { #[test] fn video_dual_audio_filter_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.processing.audio_tracks = 2; @@ -753,7 +753,7 @@ fn video_dual_audio_filter_stream() { #[test] fn video_audio_multi_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.out.output_cmd = Some(vec_strings![ @@ -842,7 +842,7 @@ fn video_audio_multi_stream() { #[test] fn video_dual_audio_multi_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.processing.audio_tracks = 2; @@ -956,7 +956,7 @@ fn video_dual_audio_multi_stream() { #[test] fn video_audio_text_multi_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.text.add_text = true; @@ -1069,7 +1069,7 @@ fn video_audio_text_multi_stream() { #[test] fn video_dual_audio_multi_filter_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.processing.audio_tracks = 2; @@ -1198,7 +1198,7 @@ fn video_dual_audio_multi_filter_stream() { #[test] fn video_audio_text_filter_stream() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.out.mode = Stream; config.processing.add_logo = false; config.processing.audio_tracks = 1; @@ -1320,7 +1320,7 @@ fn video_audio_text_filter_stream() { #[test] fn video_audio_hls() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = HLS; @@ -1407,7 +1407,7 @@ fn video_audio_hls() { #[test] fn video_audio_sub_meta_hls() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = HLS; @@ -1502,7 +1502,7 @@ fn video_audio_sub_meta_hls() { #[test] fn video_multi_audio_hls() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = HLS; @@ -1592,7 +1592,7 @@ fn video_multi_audio_hls() { #[test] fn multi_video_audio_hls() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = HLS; @@ -1707,7 +1707,7 @@ fn multi_video_audio_hls() { #[test] fn multi_video_multi_audio_hls() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); let player_control = PlayerControl::new(); let playout_stat = PlayoutStatus::new(); config.out.mode = HLS; diff --git a/tests/src/engine_generator.rs b/tests/src/engine_generator.rs index dbd53859..64a83e6e 100644 --- a/tests/src/engine_generator.rs +++ b/tests/src/engine_generator.rs @@ -53,7 +53,7 @@ fn test_ordered_list() { #[test] #[ignore] fn test_filler_list() { - let mut config = PlayoutConfig::new(None); + let mut config = PlayoutConfig::new(None, None); config.storage.filler = "assets/".into(); let f_list = filler_list(&config, 2440.0); @@ -64,7 +64,7 @@ fn test_filler_list() { #[test] #[ignore] fn test_generate_playlist_from_folder() { - let mut config = PlayoutConfig::new(None); + let mut config = PlayoutConfig::new(None, None); config.general.generate = Some(vec!["2023-09-11".to_string()]); config.processing.mode = Playlist; config.logging.log_to_file = false; @@ -98,7 +98,7 @@ fn test_generate_playlist_from_folder() { #[test] #[ignore] fn test_generate_playlist_from_template() { - let mut config = PlayoutConfig::new(None); + let mut config = PlayoutConfig::new(None, None); config.general.generate = Some(vec!["2023-09-12".to_string()]); config.general.template = Some(Template { sources: vec![ diff --git a/tests/src/lib_utils.rs b/tests/src/lib_utils.rs index 2e97442e..139d5521 100644 --- a/tests/src/lib_utils.rs +++ b/tests/src/lib_utils.rs @@ -40,7 +40,7 @@ fn get_date_tomorrow() { #[test] fn test_delta() { - let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml"))); + let mut config = PlayoutConfig::new(Some(PathBuf::from("../assets/ffplayout.yml")), None); config.mail.recipient = "".into(); config.processing.mode = Playlist; config.playlist.day_start = "00:00:00".into();