From bbb0e1371bdadf1a61f5688ad01de248ace567e4 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Sat, 8 Oct 2022 22:25:14 +0200 Subject: [PATCH] cleanup --- lib/src/filter/mod.rs | 6 +----- lib/src/utils/mod.rs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/src/filter/mod.rs b/lib/src/filter/mod.rs index f065f93c..51b24c7f 100644 --- a/lib/src/filter/mod.rs +++ b/lib/src/filter/mod.rs @@ -120,11 +120,7 @@ impl Filters { fn build_final_chain(&mut self) { self.final_chain.push_str(&self.video_chain); - - if self.final_chain.len() > 10 { - self.final_chain.push(';') - } - + self.final_chain.push(';'); self.final_chain.push_str(&self.audio_chain); self.cmd.push("-filter_complex".to_string()); diff --git a/lib/src/utils/mod.rs b/lib/src/utils/mod.rs index fa8286d5..c749d3a5 100644 --- a/lib/src/utils/mod.rs +++ b/lib/src/utils/mod.rs @@ -552,6 +552,24 @@ pub fn gen_dummy(config: &PlayoutConfig, duration: f64) -> (String, Vec) (source, cmd) } +// fn get_output_count(cmd: &[String]) -> i32 { +// let mut count = 0; + +// if let Some(index) = cmd.iter().position(|c| c == "-var_stream_map") { +// if let Some(mapping) = cmd.get(index + 1) { +// return mapping.split(' ').count() as i32; +// }; +// }; + +// for (i, param) in cmd.iter().enumerate() { +// if i > 0 && !param.starts_with('-') && !cmd[i - 1].starts_with('-') { +// count += 1; +// } +// } + +// count +// } + /// Prepare output parameters /// /// seek for multiple outputs and add mapping for it