silence ffprobe error in remote sources, fix #523

This commit is contained in:
jb-alvarado 2024-02-08 13:44:07 +01:00
parent 0188db3d0e
commit 779178a553
2 changed files with 11 additions and 9 deletions

View File

@ -13,7 +13,7 @@ use simplelog::*;
use crate::filter::FilterType::Audio;
use crate::utils::{
errors::ProcError, is_close, loop_image, sec_to_time, seek_and_length, vec_strings,
errors::ProcError, is_close, is_remote, loop_image, sec_to_time, seek_and_length, vec_strings,
JsonPlaylist, Media, OutputMode::Null, PlayerControl, PlayoutConfig, FFMPEG_IGNORE_ERRORS,
IMAGE_FORMAT,
};
@ -172,6 +172,7 @@ pub fn validate_playlist(
let pos = index + 1;
if !is_remote(&item.source) {
if item.audio.is_empty() {
if let Err(e) = item.add_probe(false) {
error!(
@ -185,6 +186,7 @@ pub fn validate_playlist(
sec_to_time(begin)
);
}
}
if item.probe.is_some() {
if let Err(e) = check_media(item.clone(), pos, begin, &config) {

View File

@ -619,7 +619,7 @@ pub fn gen_dummy(config: &PlayoutConfig, duration: f64) -> (String, Vec<String>)
// }
pub fn is_remote(path: &str) -> bool {
Regex::new(r"^(https?|rtmps?|rtp|rtsp|udp|tcp|srt)://.*")
Regex::new(r"^(https?|rtmps?|rts?p|udp|tcp|srt)://.*")
.unwrap()
.is_match(&path.to_lowercase())
}