Repository navigation
Conversation
--out=report creates no encoder, so ccxr_process_avc() gets a NULL enc_ctx. Since fecd24d it returned early in that case, which avoided a NULL dereference but also skipped all H.264 parsing. The report then said "EIA-608: No" / "CEA-708: No" for every H.264 file, even when it has captions. The only real use of the encoder was enc_ctx.timing in ccxr_set_fts(). Every caller sets enc_ctx->timing = dec_ctx->timing before process_data(), and the C code this was ported from used dec_ctx->timing, so use that. Everything else just forwards enc_ctx to C (store_hdcc, process_hdcc), which accepts NULL; keep it a raw pointer and drop the early return.
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 10181, commit 2c1c1c6:
Compared with the commit this branch was cut from: the same run as the tip of master (test 10181), 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 10178, commit f56427e:
Compared with the commit this branch was cut from: the same run as the tip of master (test 10178), 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:
On master:
The same file extracts 30 608 captions, plus 708 service 1.
Problem
--out=reportcreates no encoder, soccxr_process_avc()getsenc_ctx = NULL. Since fecd24d (#2023) it returns early in that case. That avoided a NULL dereference, but it also skips all H.264/HEVC parsing. The report's 608/708 lines come from what the decoder saw, so every H.264 file reports "No".Fix
The encoder was really used in only one place:
enc_ctx.timinginccxr_set_fts(). Every caller setsenc_ctx->timing = dec_ctx->timingbeforeprocess_data()(general_loop.c1257, 1542), and the original C code useddec_ctx->timing, so this uses that. Everywhere elseenc_ctxis only forwarded to C (store_hdcc(),process_hdcc()), which accepts NULL. It is now kept as a raw pointer, and the early return is removed.This is the same pattern as #2502 (MPEG-2 ES path). The two PRs touch different files.
Verification
Test first:
avc::tests::test_null_enc_ctx_still_parsesfeeds an SPS with a NULLenc_ctxand checksgot_seq_para. It fails on master (0) and passes with the fix. The fullcargo testpasses, as doescargo clippy -- -D warnings.Report sweep over 52 local samples (
.ts,.mpg,.vob,.wtv,.dvr-ms,.mp4,.mov): 47 reports are byte-identical. The other 5 are exactly the H.264 ones. They change fromEIA-608: No/CEA-708: NotoYes, with CC1 and service 1 detail, and each has 608 captions in an SRT extraction:31a4ca6a5c70576b7236304c8e8229b8c4dd893cSRT/708 outputs: all 93 files from the same 52 samples are byte-identical to master.
ASan: report mode on 3 of those H.264 files shows no errors, and the leaks are the same as master's (612/613 bytes).
HEVC goes through the same function. I had no local HEVC sample with captions to check it with.