ignore muxed as a private data stream warning, validate channel count

This commit is contained in:
jb-alvarado 2022-11-03 15:51:06 +01:00
parent 70213b5d64
commit 6149288d2f
2 changed files with 12 additions and 5 deletions

View File

@ -107,20 +107,26 @@ fn main() {
exit(1);
};
if ![2, 4, 6, 8].contains(&config.processing.audio_channels) {
error!(
"Encoding {} channel(s) is not allowed. Only 2, 4, 6 and 8 channels are supported!",
config.processing.audio_channels
);
exit(1);
}
if config.general.generate.is_some() {
// run a simple playlist generator and save them to disk
if let Err(e) = generate_playlist(&config, None) {
error!("{e}");
exit(1);
};
exit(0);
}
if let Some(path) = args.import {
if args.date.is_none() {
error!("Import needs date parameter!");
exit(1);
}

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; 9] = [
pub const FFMPEG_IGNORE_ERRORS: [&str; 10] = [
"ac-tex damaged",
"codec s302m, is muxed as a private data stream",
"corrupt decoded frame in stream",
"corrupt input packet in stream",
"end mismatch left",
@ -160,7 +161,7 @@ pub struct Processing {
#[serde(default = "default_tracks")]
pub audio_tracks: i32,
#[serde(default = "default_channels")]
pub audio_channels: i32,
pub audio_channels: u8,
pub add_loudnorm: bool,
pub loudnorm_ingest: bool,
pub loud_i: f32,
@ -248,7 +249,7 @@ fn default_tracks() -> i32 {
1
}
fn default_channels() -> i32 {
fn default_channels() -> u8 {
2
}