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: 2 additions & 0 deletions docs/CHANGES.TXT
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
0.96.7 (unreleased)
-------------------
- Fix: Prevent crash in Rust timing module when logging out-of-range PTS/FTS timestamps from malformed streams.
- Fix: Use dynamic current_fps instead of hardcoded 29.97 in CEA-708 SCC frame delay calculations (#2172)
- Improvement: --out report now probes both EIA-608 fields by default, so CC3/CC4 are correctly detected without requiring --output-field both (#2177)

0.96.6 (2026-02-19)
-------------------
Expand Down
12 changes: 6 additions & 6 deletions src/lib_ccx/ccx_decoders_708_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,11 @@ void dtvcc_write_scc(dtvcc_writer_ctx *writer, dtvcc_service_decoder *decoder, s
if (tv->old_cc_time_end > time_show.time_in_ms)
{
// Correct the frame delay
time_show.time_in_ms -= 1000 / 29.97;
time_show.time_in_ms -= 1000 / current_fps;
print_scc_time(time_show, buf);
buf_len = strlen(buf);
SCC_SNPRINTF("\t942c 942c");
time_show.time_in_ms += 1000 / 29.97;
time_show.time_in_ms += 1000 / current_fps;
// Clear the buffer and start pop on caption
SCC_SNPRINTF("94ae 94ae 9420 9420");
}
Expand All @@ -566,20 +566,20 @@ void dtvcc_write_scc(dtvcc_writer_ctx *writer, dtvcc_service_decoder *decoder, s
buf_len = strlen(buf);
SCC_SNPRINTF("\t942c 942c \n\n");
// Correct the frame delay
time_show.time_in_ms -= 1000 / 29.97;
time_show.time_in_ms -= 1000 / current_fps;
// Clear the buffer and start pop on caption in new time
print_scc_time(time_show, buf + buf_len);
buf_len = strlen(buf);
SCC_SNPRINTF("\t94ae 94ae 9420 9420");
time_show.time_in_ms += 1000 / 29.97;
time_show.time_in_ms += 1000 / current_fps;
}
else
{
time_show.time_in_ms -= 1000 / 29.97;
time_show.time_in_ms -= 1000 / current_fps;
print_scc_time(time_show, buf);
buf_len = strlen(buf);
SCC_SNPRINTF("\t942c 942c 94ae 94ae 9420 9420");
time_show.time_in_ms += 1000 / 29.97;
time_show.time_in_ms += 1000 / current_fps;
}

int total_subtitle_count = count_captions_lines_scc(tv);
Expand Down
17 changes: 17 additions & 0 deletions src/rust/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ 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 are correctly
// detected in the report (#2177).
self.extract = 12;
self.is_608_enabled = true;
}
OutFormat::Raw => self.write_format = OutputFormat::Raw,
OutFormat::Smptett => self.write_format = OutputFormat::SmpteTt,
Expand Down Expand Up @@ -1566,6 +1570,7 @@ impl OptionsExt for Options {
}

if self.write_format != OutputFormat::DvdRaw
&& self.write_format != OutputFormat::Null
&& self.cc_to_stdout
&& self.extract != 0
&& self.extract == 12
Expand Down Expand Up @@ -1914,6 +1919,18 @@ pub mod tests {
assert_eq!(options.write_format, OutputFormat::Null);
assert!(options.print_file_reports);
assert!(options.demux_cfg.ts_allprogram);
// Report mode should probe both EIA-608 fields (#2177)
assert_eq!(options.extract, 12);
assert!(options.is_608_enabled);
}

#[test]
fn test_out_report_with_stdout_no_conflict() {
// Report mode uses Null output, so --stdout should not conflict
// even though extract == 12 (both fields)
let (options, _) = parse_args(&["--out", "report", "--stdout"]);
assert_eq!(options.write_format, OutputFormat::Null);
assert_eq!(options.extract, 12);
}

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