format code with cargo fmt, update packages
This commit is contained in:
parent
2534059ae5
commit
42ec3ef9f9
30
Cargo.lock
generated
30
Cargo.lock
generated
@ -94,9 +94,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "3.1.12"
|
||||
version = "3.1.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c167e37342afc5f33fd87bbc870cedd020d2a6dffa05d45ccd9241fbdd146db"
|
||||
checksum = "c4b3ee449efa0c4f95cd48b00539829d3655a98e189a90617246492788d22404"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"bitflags",
|
||||
@ -124,9 +124,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_lex"
|
||||
version = "0.1.1"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "189ddd3b5d32a70b35e7686054371742a937b0d99128e76dde6340210e966669"
|
||||
checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213"
|
||||
dependencies = [
|
||||
"os_str_bytes",
|
||||
]
|
||||
@ -232,7 +232,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "file-rotate"
|
||||
version = "0.6.0"
|
||||
source = "git+https://github.com/jb-alvarado/file-rotate.git#64d4951d8d99e0db5ef541f82e02a21e07fecebe"
|
||||
source = "git+https://github.com/jb-alvarado/file-rotate.git#46a47225f3f0e0fd23ca42b2dea527c55daf1a12"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"flate2",
|
||||
@ -658,9 +658,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||
|
||||
[[package]]
|
||||
name = "lettre"
|
||||
version = "0.10.0-rc.5"
|
||||
version = "0.10.0-rc.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5144148f337be14dabfc0f0d85b691a68ac6c77ef22a5c47c5504b70a7c9fcf3"
|
||||
checksum = "2f6c70001f7ee6c93b6687a06607c7a38f9a7ae460139a496c23da21e95bc289"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"email-encoding",
|
||||
@ -679,9 +679,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.124"
|
||||
version = "0.2.125"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "21a41fed9d98f27ab1c6d161da622a4fa35e8a54a8adc24bbf3ddd0ef70b0e50"
|
||||
checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"
|
||||
|
||||
[[package]]
|
||||
name = "linked-hash-map"
|
||||
@ -722,9 +722,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.4.1"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
|
||||
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
||||
|
||||
[[package]]
|
||||
name = "mime"
|
||||
@ -881,9 +881,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "num-integer"
|
||||
version = "0.1.44"
|
||||
version = "0.1.45"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
|
||||
checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-traits",
|
||||
@ -1207,9 +1207,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.79"
|
||||
version = "1.0.80"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95"
|
||||
checksum = "f972498cf015f7c0746cac89ebe1d6ef10c293b94175a243a2d9442c163d9944"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
|
@ -14,7 +14,7 @@ crossbeam-channel = "0.5"
|
||||
ffprobe = "0.3"
|
||||
file-rotate = { git = "https://github.com/jb-alvarado/file-rotate.git" }
|
||||
jsonrpc-http-server = "18.0"
|
||||
lettre = "0.10.0-rc.5"
|
||||
lettre = "0.10.0-rc.6"
|
||||
log = "0.4"
|
||||
notify = "4.0"
|
||||
once_cell = "1.10"
|
||||
|
@ -94,10 +94,7 @@ fn pad(aspect: f64, chain: &mut Filters, config: &GlobalConfig) {
|
||||
|
||||
fn fps(fps: f64, chain: &mut Filters, config: &GlobalConfig) {
|
||||
if fps != config.processing.fps {
|
||||
chain.add_filter(
|
||||
&format!("fps={}", config.processing.fps),
|
||||
"video",
|
||||
)
|
||||
chain.add_filter(&format!("fps={}", config.processing.fps), "video")
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,10 +110,7 @@ fn scale(width: i64, height: i64, aspect: f64, chain: &mut Filters, config: &Glo
|
||||
}
|
||||
|
||||
if !is_close(aspect, config.processing.aspect, 0.03) {
|
||||
chain.add_filter(
|
||||
&format!("setdar=dar={}", config.processing.aspect),
|
||||
"video"
|
||||
)
|
||||
chain.add_filter(&format!("setdar=dar={}", config.processing.aspect), "video")
|
||||
}
|
||||
}
|
||||
|
||||
@ -228,10 +222,7 @@ fn extend_audio(node: &mut Media, chain: &mut Filters) {
|
||||
let duration_float = duration.clone().parse::<f64>().unwrap();
|
||||
|
||||
if node.out - node.seek > duration_float - node.seek + 0.1 {
|
||||
chain.add_filter(
|
||||
&format!("apad=whole_dur={}", node.out - node.seek),
|
||||
"audio",
|
||||
)
|
||||
chain.add_filter(&format!("apad=whole_dur={}", node.out - node.seek), "audio")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -241,7 +232,13 @@ fn add_loudnorm(node: &mut Media, chain: &mut Filters, config: &GlobalConfig) {
|
||||
// add single pass loudnorm filter to audio line
|
||||
|
||||
if node.probe.is_some()
|
||||
&& !node.probe.clone().unwrap().audio_streams.unwrap().is_empty()
|
||||
&& !node
|
||||
.probe
|
||||
.clone()
|
||||
.unwrap()
|
||||
.audio_streams
|
||||
.unwrap()
|
||||
.is_empty()
|
||||
&& config.processing.add_loudnorm
|
||||
{
|
||||
let loud_filter = format!(
|
||||
@ -255,10 +252,7 @@ fn add_loudnorm(node: &mut Media, chain: &mut Filters, config: &GlobalConfig) {
|
||||
|
||||
fn audio_volume(chain: &mut Filters, config: &GlobalConfig) {
|
||||
if config.processing.volume != 1.0 {
|
||||
chain.add_filter(
|
||||
&format!("volume={}", config.processing.volume),
|
||||
"audio",
|
||||
)
|
||||
chain.add_filter(&format!("volume={}", config.processing.volume), "audio")
|
||||
}
|
||||
}
|
||||
|
||||
@ -280,12 +274,7 @@ fn fps_calc(r_frame_rate: String) -> f64 {
|
||||
fps
|
||||
}
|
||||
|
||||
fn realtime_filter(
|
||||
node: &mut Media,
|
||||
chain: &mut Filters,
|
||||
config: &GlobalConfig,
|
||||
codec_type: &str,
|
||||
) {
|
||||
fn realtime_filter(node: &mut Media, chain: &mut Filters, config: &GlobalConfig, codec_type: &str) {
|
||||
// this realtime filter is important for HLS output to stay in sync
|
||||
|
||||
let mut t = "";
|
||||
|
@ -154,7 +154,9 @@ pub fn ingest_server(
|
||||
}
|
||||
|
||||
drop(ingest_reader);
|
||||
proc_control.server_is_running.store(false, Ordering::SeqCst);
|
||||
proc_control
|
||||
.server_is_running
|
||||
.store(false, Ordering::SeqCst);
|
||||
|
||||
if let Err(e) = proc_control.wait(Ingest) {
|
||||
error!("{e}")
|
||||
|
@ -1,6 +1,9 @@
|
||||
use std::{
|
||||
process,
|
||||
sync::{Arc, Mutex, atomic::{AtomicBool, AtomicUsize}},
|
||||
sync::{
|
||||
atomic::{AtomicBool, AtomicUsize},
|
||||
Arc, Mutex,
|
||||
},
|
||||
thread,
|
||||
};
|
||||
|
||||
@ -27,7 +30,10 @@ pub fn source_generator(
|
||||
let get_source = match config.processing.mode.as_str() {
|
||||
"folder" => {
|
||||
info!("Playout in folder mode");
|
||||
debug!("Monitor folder: <b><magenta>{}</></b>", &config.storage.path);
|
||||
debug!(
|
||||
"Monitor folder: <b><magenta>{}</></b>",
|
||||
&config.storage.path
|
||||
);
|
||||
|
||||
let folder_source = FolderSource::new(current_list, index);
|
||||
let node_clone = folder_source.nodes.clone();
|
||||
@ -39,12 +45,7 @@ pub fn source_generator(
|
||||
}
|
||||
"playlist" => {
|
||||
info!("Playout in playlist mode");
|
||||
let program = CurrentProgram::new(
|
||||
playout_stat,
|
||||
is_terminated,
|
||||
current_list,
|
||||
index,
|
||||
);
|
||||
let program = CurrentProgram::new(playout_stat, is_terminated, current_list, index);
|
||||
|
||||
Box::new(program) as Box<dyn Iterator<Item = Media>>
|
||||
}
|
||||
|
@ -54,7 +54,10 @@ pub fn output(log_format: &str) -> process::Child {
|
||||
enc_cmd.append(&mut preview);
|
||||
enc_cmd.append(&mut output_cmd.iter().map(String::as_str).collect());
|
||||
|
||||
debug!("Encoder CMD: <bright-blue>\"ffmpeg {}\"</>", enc_cmd.join(" "));
|
||||
debug!(
|
||||
"Encoder CMD: <bright-blue>\"ffmpeg {}\"</>",
|
||||
enc_cmd.join(" ")
|
||||
);
|
||||
|
||||
let enc_proc = match Command::new("ffmpeg")
|
||||
.args(enc_cmd)
|
||||
|
@ -124,7 +124,8 @@ pub fn json_rpc_server(
|
||||
|
||||
info!("Move to last clip");
|
||||
let mut data_map = Map::new();
|
||||
let mut media = play_control.current_list.lock().unwrap()[index - 2].clone();
|
||||
let mut media =
|
||||
play_control.current_list.lock().unwrap()[index - 2].clone();
|
||||
play_control.index.fetch_sub(2, Ordering::SeqCst);
|
||||
media.add_probe();
|
||||
|
||||
|
@ -17,7 +17,7 @@ pub struct Args {
|
||||
long,
|
||||
help = "Generate playlist for date. Date-range is possible, like: 2022-01-01 - 2022-01-10.",
|
||||
name = "YYYY-MM-DD",
|
||||
multiple_values=true
|
||||
multiple_values = true
|
||||
)]
|
||||
pub generate: Option<Vec<String>>,
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
/// It also respect the shuffle/sort mode.
|
||||
///
|
||||
/// Beside that it is really very basic, without any logic.
|
||||
|
||||
use std::{
|
||||
fs::{create_dir_all, write},
|
||||
path::Path,
|
||||
@ -20,7 +19,6 @@ use simplelog::*;
|
||||
use crate::input::FolderSource;
|
||||
use crate::utils::{json_serializer::Playlist, GlobalConfig, Media};
|
||||
|
||||
|
||||
/// Generate a vector with dates, from given range.
|
||||
fn get_date_range(date_range: &[String]) -> Vec<String> {
|
||||
let mut range = vec![];
|
||||
|
@ -1,10 +1,15 @@
|
||||
use std::{path::Path, sync::{atomic::{AtomicBool, Ordering}, Arc}};
|
||||
use std::{
|
||||
path::Path,
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
},
|
||||
};
|
||||
|
||||
use simplelog::*;
|
||||
|
||||
use crate::utils::{sec_to_time, GlobalConfig, MediaProbe, Playlist};
|
||||
|
||||
|
||||
/// Validate a given playlist, to check if:
|
||||
///
|
||||
/// - the source files are existing
|
||||
@ -23,7 +28,7 @@ pub fn validate_playlist(playlist: Playlist, is_terminated: Arc<AtomicBool>, con
|
||||
|
||||
for item in playlist.program.iter() {
|
||||
if is_terminated.load(Ordering::SeqCst) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
if Path::new(&item.source).is_file() {
|
||||
|
@ -10,8 +10,8 @@ use std::{
|
||||
|
||||
use file_rotate::{
|
||||
compression::Compression,
|
||||
suffix::{AppendTimestamp, FileLimit},
|
||||
ContentLimit, FileRotate,
|
||||
suffix::{AppendTimestamp, DateFrom, FileLimit},
|
||||
ContentLimit, FileRotate, TimeFrequency,
|
||||
};
|
||||
use lettre::{
|
||||
message::header, transport::smtp::authentication::Credentials, Message, SmtpTransport,
|
||||
@ -184,8 +184,9 @@ pub fn init_logging() -> Vec<Box<dyn SharedLogger>> {
|
||||
AppendTimestamp::with_format(
|
||||
"%Y-%m-%d",
|
||||
FileLimit::MaxFiles(app_config.backup_count),
|
||||
DateFrom::DateYesterday,
|
||||
),
|
||||
ContentLimit::Date,
|
||||
ContentLimit::Time(TimeFrequency::Daily),
|
||||
Compression::None,
|
||||
)
|
||||
};
|
||||
|
@ -365,10 +365,7 @@ pub fn seek_and_length(src: String, seek: f64, out: f64, duration: f64) -> Vec<S
|
||||
source_cmd.append(&mut vec!["-i".to_string(), src]);
|
||||
|
||||
if duration > out {
|
||||
source_cmd.append(&mut vec![
|
||||
"-t".to_string(),
|
||||
format!("{}", out - seek),
|
||||
]);
|
||||
source_cmd.append(&mut vec!["-t".to_string(), format!("{}", out - seek)]);
|
||||
}
|
||||
|
||||
source_cmd
|
||||
|
Loading…
x
Reference in New Issue
Block a user