Repository navigation
[FIX] Restore CEA-708 output in the min-rust (DISABLE_RUST) build - #2399
Open
Deepak-negi11 wants to merge 1 commit into
Open
Deepak-negi11 wants to merge 1 commit into
Deepak-negi11 wants to merge 1 commit into
Conversation
Deepak-negi11
force-pushed
the
fix/min-rust-708
branch
from
October 18, 2026 18:15
cecf187 to
4589a56
Compare
The min-rust build (CCExtractor#2207) should produce the same output as the Rust build, but it wrote no CEA-708 captions at all, wrote unreadable 2-byte characters once fed, and crashed with --out=report. - CCExtractor#1738 removed both the DISABLE_RUST guard around ccxr_process_cc_data() and the dtvcc_process_data() call in do_cb(), so with DISABLE_RUST the 708 data went to Rust, which returns early because dtvcc_rust is NULL. Add process_cc_data_dtvcc(), the C counterpart of ccxr_process_cc_data()/do_cb_dtvcc_rust(): it passes every 708 block to the C decoder before do_cb() runs, with the same rules (skip RAW output, same time window check), so the timing matches the Rust build. - write_utf16_char() always wrote 2 bytes (CCExtractor#1451). Without a charset that raw UTF-16 reached the file. Write 2 bytes only for UTF-16/UCS-2 charsets, as the Rust writer does (write_char/is_utf16_charset). - With --out=report there is no encoder, and dtvcc_screen_print() dereferenced it. Only decode service blocks when an encoder exists, as the Rust decoder does. The Rust build is unchanged: its output is identical before and after on all compared samples.
Deepak-negi11
force-pushed
the
fix/min-rust-708
branch
from
October 18, 2026 18:29
4589a56 to
2689f41
Compare
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
Repro instructions:
Samples from https://streams.videolan.org/streams/ts/ (more details in #2398). Build both versions from the same commit:
./build -min-rust(C) and./build(Rust).CC/wabc-4pm-ota.clip1.tsatsc-cea-708-dtvcc-and-cea-608.ts--out=reportonatsc-cea-708-dtvcc-and-cea-608.tsProblem
#2207 added a C-only build (min-rust) that should give the same output as the Rust build. For 708 captions it doesn't: #1738 removed the code that sends 708 data to the C decoder. The data goes to the Rust decoder instead, which isn't running in this build, so no 708 captions are written and
--out=reportdoesn't list the 708 services.Sending the data to the C decoder again showed two more problems in the C 708 code:
--out=reportthere's no output writer, and the C decoder used it anyway, which crashed.Fix
process_cc_data_dtvcc(), the C version ofccxr_process_cc_data(). In the C-only build it sends all 708 blocks to the C decoder beforedo_cb()runs, with the same rules as Rust: skip RAW output, same time-window check. So the timing matches the Rust build too.--out=reportthere's no output writer. Once 708 data reaches the C decoder again (fix 1), the C decoder would use that missing writer and crash, so the decoder now skips decoding when there is no writer, the same as the Rust decoder.Testing
--out=raw --service all,--out=bin --service all, and RCWT (.bin) input files, which is a non-TS path.