Repository navigation
[FIX] Rust teletext decoder: fix bugs that stopped it producing any output, sync with telxcc.c - #2371
Deepak-negi11 wants to merge 1 commit into
Conversation
CCExtractor CI platform finished running the test files on linux. 170/237 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 9596, commit e313f70:
Fail on both but produce different output — behaviour moved even though the verdict did not:
Fail there, pass here:
Compared with the commit this branch was cut from: the same run as the tip of master (test 9596), so the comparison above already covers it. This branch changes the behaviour of 30 test(s) relative to the tip of master. Those are the ones worth looking at; anything else in the list fails the same way on both sides. |
CCExtractor CI platform finished running the test files on windows. 154/237 tests matched the approved output:
83 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 9589, commit 670a5ab:
Compared with the commit this branch was cut from: the same run as the tip of master (test 9589), 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. |
The Rust port of telxcc.c (lib_ccxr/src/teletext.rs) is not called yet, and as it stands it could never produce output: - receiving_data was never set to true (C sets it at telxcc.c:1072), so every row packet was dropped - the parity check was inverted, so every valid character became a space - the line trimming loop from telxcc.c:690-701 was missing, so col_stop stayed 40 and text[row][40] panicked - a non-BCD page number (e.g. 0x7a0) indexed seen_sub_page[1000] out of bounds; read the leading digits like C's atoi() - close() dropped the last buffered page instead of outputting it Also bring over later telxcc.c changes: hide a page when the next one starts (CCExtractor#2292), honour --ttxtforcelatin (CCExtractor#1821), only print the page notice with file reports, decode Hamming 8/4 errors as 0x0f like unham_8_4(), and treat a Levenshtein distance equal to the limit as a match like fuzzy_memcmp(). Multi-page extraction is left out: CCExtractor#2356 is changing that logic in telxcc.c.
53f634b to
d0dff04
Compare
|
Rebased on master, dropped the empty CI commit, and removed the multi-page part (#2356 is fixing that in C). About the Sample Platform: the Linux "30 changed tests" compare against a master run where 75 tests failed that pass here, and Windows shows 0 changes. This PR can't change output yet: nothing calls teletext.rs, and C never reads the new print_file_reports field. The real-sample check (6/6 cues identical to telxcc.c on the ZDF page 777 sample) uses this small test program: https://gist.github.com/Deepak-negi11/346512f8c305ac681e902c4fec0a06d7 |
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
Repro instructions:
Sample:
DVB-S.teletext_subtitles_777.tsfrom https://streams.videolan.org/streams/ts/Teletext/ (first 20 MB, teletext page 777).The Rust decoder isn't called by CCExtractor yet, so I fed the sample to it with this small test program, which reads packets the same way
tlt_process_pes_packet()does: https://gist.github.com/Deepak-negi11/346512f8c305ac681e902c4fec0a06d7ccextractor --teletext(C)Problem
lib_ccxr/src/teletext.rsis a Rust port oftelxcc.c. It isn't used yet, and as it is it can never produce output:receiving_datais never set to true (C sets it attelxcc.c:1072), so every text row is dropped.telxcc.c:690-701is missing, so it reads past the end of a row and crashes.0x7a0is used as an index into a 1000-entry array and crashes. C'satoi()reads it as 7.close()drops the last caption instead of writing it.Changes (Rust only; CCExtractor's output doesn't change yet)
telxcc.c: a caption ends exactly when the next page starts (Fix 40ms gap in rolling teletext subtitles #2292),--ttxtforcelatin(fix(teletext): Add --ttxtforcelatin option to force Latin G0 charset #1821), the page notice is only printed with file reports, unreadable Hamming bytes are handled like C'sunham_8_4, andfuzzy_cmptreats a distance equal to the limit as a match, like C.--tpagelists,--tpages-all) is left out on purpose: [FIX] Keep per-page teletext state when extracting multiple pages #2356 is fixing that logic intelxcc.c, and the Rust side should follow it once it's merged.Testing
cargo test,cargo fmt --checkandcargo clippy -- -D warningspass.