add ignore, use ProcessUnit for error logging

This commit is contained in:
jb-alvarado 2022-10-25 14:34:03 +02:00
parent d5356803d0
commit 4b92c7efd2
4 changed files with 8 additions and 7 deletions

View File

@ -202,7 +202,7 @@ pub fn write_hls(
let enc_err = BufReader::new(enc_proc.stderr.take().unwrap());
*proc_control.encoder_term.lock().unwrap() = Some(enc_proc);
if let Err(e) = stderr_reader(enc_err, "Writer", proc_control.clone()) {
if let Err(e) = stderr_reader(enc_err, Encoder, proc_control.clone()) {
error!("{e:?}")
};

View File

@ -18,8 +18,8 @@ pub use hls::write_hls;
use crate::input::{ingest_server, source_generator};
use ffplayout_lib::utils::{
sec_to_time, stderr_reader, Decoder, OutputMode::*, PlayerControl, PlayoutConfig,
PlayoutStatus, ProcessControl,
sec_to_time, stderr_reader, OutputMode::*, PlayerControl, PlayoutConfig, PlayoutStatus,
ProcessControl, ProcessUnit::*,
};
use ffplayout_lib::vec_strings;
@ -68,7 +68,7 @@ pub fn player(
let enc_p_ctl = proc_control.clone();
// spawn a thread to log ffmpeg output error messages
let error_encoder_thread = thread::spawn(move || stderr_reader(enc_err, "Encoder", enc_p_ctl));
let error_encoder_thread = thread::spawn(move || stderr_reader(enc_err, Encoder, enc_p_ctl));
let proc_control_c = proc_control.clone();
let mut ingest_receiver = None;
@ -137,7 +137,7 @@ pub fn player(
let dec_p_ctl = proc_control.clone();
let error_decoder_thread =
thread::spawn(move || stderr_reader(dec_err, "Decoder", dec_p_ctl));
thread::spawn(move || stderr_reader(dec_err, Decoder, dec_p_ctl));
loop {
// when server is running, read from channel

View File

@ -19,8 +19,9 @@ pub const IMAGE_FORMAT: [&str; 21] = [
];
// Some well known errors can be safely ignore
pub const FFMPEG_IGNORE_ERRORS: [&str; 4] = [
pub const FFMPEG_IGNORE_ERRORS: [&str; 5] = [
"ac-tex damaged",
"end mismatch left",
"Referenced QT chapter track not found",
"skipped MB in I-frame at",
"Warning MVs not available",

View File

@ -638,7 +638,7 @@ pub fn format_log_line(line: String, level: &str) -> String {
/// and log the output.
pub fn stderr_reader(
buffer: BufReader<ChildStderr>,
suffix: &str,
suffix: ProcessUnit,
mut proc_control: ProcessControl,
) -> Result<(), Error> {
for line in buffer.lines() {