Skip to content

Commit 7889a41

Browse files
committed
Add --split-dvb-subs validation in Rust parser
1 parent 9e816a1 commit 7889a41

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/rust/src/parser.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,30 @@ impl OptionsExt for Options {
15541554
);
15551555
}
15561556

1557+
// Validation for --split-dvb-subs option
1558+
if self.split_dvb_subs {
1559+
if self.cc_to_stdout {
1560+
fatal!(
1561+
cause = ExitCause::IncompatibleParameters;
1562+
"Error: --split-dvb-subs cannot be used with stdout.\n"
1563+
);
1564+
}
1565+
1566+
if self.demux_cfg.nb_ts_cappid > 0 {
1567+
fatal!(
1568+
cause = ExitCause::IncompatibleParameters;
1569+
"Error: --split-dvb-subs cannot be used with manual PID selection (-pn).\n"
1570+
);
1571+
}
1572+
1573+
if self.multiprogram {
1574+
fatal!(
1575+
cause = ExitCause::IncompatibleParameters;
1576+
"Error: --split-dvb-subs cannot be used with -multiprogram.\n"
1577+
);
1578+
}
1579+
}
1580+
15571581
if self.write_format == OutputFormat::WebVtt && self.enc_cfg.encoding != Encoding::UTF8 {
15581582
self.enc_cfg.encoding = Encoding::UTF8;
15591583
println!("Note: Output format is WebVTT, forcing UTF-8");

0 commit comments

Comments
 (0)