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::filter::FilterType::Audio;
|
||||||
use crate::utils::{
|
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,
|
JsonPlaylist, Media, OutputMode::Null, PlayerControl, PlayoutConfig, FFMPEG_IGNORE_ERRORS,
|
||||||
IMAGE_FORMAT,
|
IMAGE_FORMAT,
|
||||||
};
|
};
|
||||||
@ -172,6 +172,7 @@ pub fn validate_playlist(
|
|||||||
|
|
||||||
let pos = index + 1;
|
let pos = index + 1;
|
||||||
|
|
||||||
|
if !is_remote(&item.source) {
|
||||||
if item.audio.is_empty() {
|
if item.audio.is_empty() {
|
||||||
if let Err(e) = item.add_probe(false) {
|
if let Err(e) = item.add_probe(false) {
|
||||||
error!(
|
error!(
|
||||||
@ -185,6 +186,7 @@ pub fn validate_playlist(
|
|||||||
sec_to_time(begin)
|
sec_to_time(begin)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if item.probe.is_some() {
|
if item.probe.is_some() {
|
||||||
if let Err(e) = check_media(item.clone(), pos, begin, &config) {
|
if let Err(e) = check_media(item.clone(), pos, begin, &config) {
|
||||||
|
@ -619,7 +619,7 @@ pub fn gen_dummy(config: &PlayoutConfig, duration: f64) -> (String, Vec<String>)
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
pub fn is_remote(path: &str) -> bool {
|
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()
|
.unwrap()
|
||||||
.is_match(&path.to_lowercase())
|
.is_match(&path.to_lowercase())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user