diff --git a/ffplayout-engine/src/rpc/mod.rs b/ffplayout-engine/src/rpc/mod.rs index ee931d1e..69be3546 100644 --- a/ffplayout-engine/src/rpc/mod.rs +++ b/ffplayout-engine/src/rpc/mod.rs @@ -115,7 +115,11 @@ fn get_media_map(media: Media) -> Value { } /// prepare json object for response -fn get_data_map(config: &PlayoutConfig, media: Media, server_is_running: bool) -> Map { +fn get_data_map( + config: &PlayoutConfig, + media: Media, + server_is_running: bool, +) -> Map { let mut data_map = Map::new(); let begin = media.begin.unwrap_or(0.0); @@ -321,7 +325,11 @@ pub fn json_rpc_server( // get infos about current clip if map.contains_key("media") && &map["media"] == "current" { if let Some(media) = play_control.current_media.lock().unwrap().clone() { - let data_map = get_data_map(&config, media, proc.server_is_running.load(Ordering::SeqCst)); + let data_map = get_data_map( + &config, + media, + proc.server_is_running.load(Ordering::SeqCst), + ); return Ok(Value::Object(data_map)); }; diff --git a/lib/src/filter/mod.rs b/lib/src/filter/mod.rs index 0b1b6bf3..867cb4a8 100644 --- a/lib/src/filter/mod.rs +++ b/lib/src/filter/mod.rs @@ -290,20 +290,14 @@ fn overlay(node: &mut Media, chain: &mut Filters, config: &PlayoutConfig) { && &node.category != "advertisement" { let mut scale = String::new(); - let re = Regex::new(r"[)(\d\w-]+:[)(\d\w-]+").unwrap(); - let mut logo = config.processing.logo.clone(); - if cfg!(windows) { - logo = logo.replace('\\', "/").replace(':', "\\\\:"); - } - - if re.is_match(&config.processing.logo_scale) { + if !config.processing.logo_scale.is_empty() { scale = format!(",scale={}", config.processing.logo_scale); } let mut logo_chain = format!( "null[v];movie={}:loop=0,setpts=N/(FRAME_RATE*TB),format=rgba,colorchannelmixer=aa={}{scale}[l];[v][l]{}:shortest=1", - logo, config.processing.logo_opacity, config.processing.logo_filter + config.processing.logo.replace('\\', "/").replace(':', "\\\\:"), config.processing.logo_opacity, config.processing.logo_filter ); if node.last_ad.unwrap_or(false) { diff --git a/lib/src/utils/config.rs b/lib/src/utils/config.rs index 78a5ebd3..d2795be0 100644 --- a/lib/src/utils/config.rs +++ b/lib/src/utils/config.rs @@ -358,6 +358,12 @@ impl PlayoutConfig { config.processing.add_logo = false; } + config.processing.logo_scale = config + .processing + .logo_scale + .trim_end_matches('~') + .to_string(); + if config.processing.audio_tracks < 1 { config.processing.audio_tracks = 1 }