Skip to content

Commit

Permalink
fix: hardsubx erros
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekmedia committed Aug 9, 2023
1 parent 66bdb81 commit af70420
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,31 +527,31 @@ fn main() {
}

if let Some(ref value) = args.min_sub_duration {
if value == 0.0 {
if *value == 0.0 {
println!("Invalid minimum subtitle duration");
std::process::exit(ExitCode::MalformedParameter as i32);
}
opt.hardsubx_min_sub_duration = Some(value);
opt.hardsubx_min_sub_duration = Some(*value);
}

if args.detect_italics {
opt.hardsubx_detect_italics = true;
}

if let Some(ref value) = args.conf_thresh {
if !(0.0..=100.0).contains(&value) {
if !(0.0..=100.0).contains(value) {
println!("Invalid confidence threshold, valid values are between 0 & 100");
std::process::exit(ExitCode::MalformedParameter as i32);
}
opt.hardsubx_conf_thresh = Some(value);
opt.hardsubx_conf_thresh = Some(*value);
}

if let Some(ref value) = args.whiteness_thresh {
if !(0.0..=100.0).contains(&value) {
if !(0.0..=100.0).contains(value) {
println!("Invalid whiteness threshold, valid values are between 0 & 100");
std::process::exit(ExitCode::MalformedParameter as i32);
}
opt.hardsubx_lum_thresh = Some(value);
opt.hardsubx_lum_thresh = Some(*value);
}
}
} // END OF HARDSUBX
Expand Down
6 changes: 3 additions & 3 deletions src/rust/src/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ pub struct CcxSOptions {
pub append_mode: bool,
pub ucla: bool,
pub tickertext: bool,
pub hardsubx: Option<i32>,
pub hardsubx_and_common: Option<i32>,
pub hardsubx: bool,
pub hardsubx_and_common: bool,
pub dvblang: Option<String>,
pub ocrlang: Option<String>,
pub ocr_oem: Option<i32>,
Expand All @@ -447,7 +447,7 @@ pub struct CcxSOptions {
pub hardsubx_ocr_mode: Option<i32>,
pub hardsubx_subcolor: Option<i32>,
pub hardsubx_min_sub_duration: Option<f32>,
pub hardsubx_detect_italics: Option<i32>,
pub hardsubx_detect_italics: bool,
pub hardsubx_conf_thresh: Option<f32>,
pub hardsubx_hue: Option<f32>,
pub hardsubx_lum_thresh: Option<f32>,
Expand Down

0 comments on commit af70420

Please sign in to comment.