Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rust/src/demuxer/stream_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ pub fn detect_myth(ctx: &mut CcxDemuxer) -> i32 {
uc.copy_from_slice(&ctx.startbytes[..3]);

for &byte in &ctx.startbytes[3..ctx.startbytes_avail as usize] {
if (uc == [b't', b'v', b'0']) || (uc == [b'T', b'V', b'0']) {
if (uc == *b"tv0") || (uc == *b"TV0") {
vbi_blocks += 1;
}

Expand Down
13 changes: 13 additions & 0 deletions src/rust/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ impl OptionsExt for Options {
self.messages_target = OutputTarget::Quiet;
self.print_file_reports = true;
self.demux_cfg.ts_allprogram = true;
// Probe both EIA-608 fields so CC3/CC4 presence is reported accurately (issue #2177).
// Runs before --output-field parsing, so an explicit field choice still overrides this.
self.extract = 12;
}
OutFormat::Raw => self.write_format = OutputFormat::Raw,
OutFormat::Smptett => self.write_format = OutputFormat::SmpteTt,
Expand Down Expand Up @@ -1573,6 +1576,7 @@ impl OptionsExt for Options {
&& self.cc_to_stdout
&& self.extract != 0
&& self.extract == 12
&& !self.print_file_reports
{
fatal!(
cause = ExitCause::IncompatibleParameters;
Expand Down Expand Up @@ -1918,6 +1922,15 @@ pub mod tests {
assert_eq!(options.write_format, OutputFormat::Null);
assert!(options.print_file_reports);
assert!(options.demux_cfg.ts_allprogram);
// issue #2177: report mode probes both fields by default
assert_eq!(options.extract, 12);
}

#[test]
fn test_out_report_explicit_field_overrides_both() {
let (options, _) = parse_args(&["--out", "report", "--output-field", "1"]);
assert!(options.print_file_reports);
assert_eq!(options.extract, 1);
}

// =========================================================================
Expand Down
Loading