Repository navigation
Conversation
|
@cfsmp3 Small fix: |
CCExtractor CI platform finished running the test files on windows. 171/238 tests matched the approved output:
67 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.
Compared with the tip of master — test 10125, commit 034fdbc:
Compared with the commit this branch was cut from: the same run as the tip of master (test 10125), so the comparison above already covers it. No test changes behaviour relative to the tip of master: every failure above fails there too, byte for byte. The approved output for those tests is out of date, which is a baseline to review rather than a regression in this branch. |
CCExtractor CI platform finished running the test files on linux. 171/238 tests matched the approved output:
67 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.
Compared with the tip of master — test 10124, commit 034fdbc:
Compared with the commit this branch was cut from: the same run as the tip of master (test 10124), so the comparison above already covers it. No test changes behaviour relative to the tip of master: every failure above fails there too, byte for byte. The approved output for those tests is out of date, which is a baseline to review rather than a regression in this branch. |
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
Repro instructions:
Sample: c83f765c…06cd.ts (has CEA-608 and CEA-708 service 1).
CR bytes in the files written with
--lf:604dad8eout.srtout.p1.svc01.srt--out=sami--out=ttxtWith
--out=ttxtit is mixed on master: the last row of a caption ends in\n(fromencoded_end_frame), the rows before it in\r\n.Problem
--lf("Use LF (UNIX) instead of CRLF (DOS, Windows) as line terminator") is ignored by the CEA-708 writer. In the same run the 608 file uses LF and the 708 file uses CRLF.Root cause
The Rust 708 writer (
tv_screen.rs) has"\r\n"hardcoded inwrite_srt,write_transcript,write_samiandwrite_sami_header. The C writer (ccx_decoders_708_output.c) usesencoder->encoded_crlfin all of them, which is"\n"with--lf.Fix
Writergets acrlffield, set to"\n"whenccx_options.enc_cfg.line_terminator_lfis on and"\r\n"otherwise (the Rust WebVTT header code reads the same option). The SRT, SAMI and transcript writers use it instead of"\r\n". SCC is unchanged (it uses\nin both the C and the Rust writer).I didn't use
encoded_crlfitself because with--unicodeit is UTF-16, and the 708 text isn't. Switching to it would change 708--unicodeoutput, which is a separate issue (#2450).Tests
test_708_text_formats_honor_lf: writes SRT, SAMI and transcript without--lf(checks the exact CRLF output) and with--lf(checks there is no CR left). It can't pass on master, where the 708 writer always writes\r\n; it passes with the fix.cargo test: 449 passed (src/rust), 101 passed (lib_ccxr).cargo fmt --checkandcargo clippy -- -D warningsare clean in both crates.--lfthe 708 srt, sami, txt and scc files are byte-identical to master. With--lfthey equal master's output with the CRs removed. The 608 file is identical to master.Note: #2484 (mine) and #2486 also edit
tv_screen.rs(write_row). Whichever is merged later may need a small rebase.