silence ffprobe error in remote sources, fix #523
This commit is contained in:
parent
0188db3d0e
commit
779178a553
@ -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,18 +172,20 @@ pub fn validate_playlist(
|
||||
|
||||
let pos = index + 1;
|
||||
|
||||
if item.audio.is_empty() {
|
||||
if let Err(e) = item.add_probe(false) {
|
||||
if !is_remote(&item.source) {
|
||||
if item.audio.is_empty() {
|
||||
if let Err(e) = item.add_probe(false) {
|
||||
error!(
|
||||
"[Validation] Error on position <yellow>{pos:0>3}</> <yellow>{}</>: {e}",
|
||||
sec_to_time(begin)
|
||||
);
|
||||
}
|
||||
} else if let Err(e) = item.add_probe(true) {
|
||||
error!(
|
||||
"[Validation] Error on position <yellow>{pos:0>3}</> <yellow>{}</>: {e}",
|
||||
sec_to_time(begin)
|
||||
);
|
||||
}
|
||||
} else if let Err(e) = item.add_probe(true) {
|
||||
error!(
|
||||
"[Validation] Error on position <yellow>{pos:0>3}</> <yellow>{}</>: {e}",
|
||||
sec_to_time(begin)
|
||||
);
|
||||
}
|
||||
|
||||
if item.probe.is_some() {
|
||||
|
@ -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())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user