Skip to content

Commit 92389cf

Browse files
cfsmp3Varadraj75claude
authored
ci: add dual build artifacts to compare C vs Rust code paths (#2207)
* fix: flush pending EIT sections in EPG_free() before freeing buffers * ci: add dual build artifacts to compare C vs Rust code paths Add -min-rust flag to linux/build that passes -DDISABLE_RUST to gcc, causing switchable modules (DTVCC, demuxer, AVC, networking, hex utils) to use their C implementations instead of Rust. The Rust library still compiles since many modules are Rust-only. The Linux CI now produces two artifacts: - "CCExtractor Linux build" — min Rust (C paths where available) - "CCExtractor Linux build (with migrations)" — max Rust Both should produce identical output on the sample platform. If they diverge, it means a Rust port introduced a behavioral difference. The sample platform will need a corresponding update to recognize and test the new "with migrations" artifact. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Varadraj75 <agrawalvaradraj2007@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 578abca commit 92389cf

3 files changed

Lines changed: 47 additions & 1 deletion

File tree

.github/workflows/build_linux.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: sudo apt update && sudo apt-get install libgpac-dev libtesseract-dev libavcodec-dev libavdevice-dev libx11-dev libxcb1-dev libxcb-shm0-dev
3434
- uses: actions/checkout@v6
3535
- name: build
36-
run: ./build -hardsubx
36+
run: ./build -hardsubx -min-rust
3737
working-directory: ./linux
3838
- name: Display version information
3939
run: ./ccextractor --version
@@ -49,6 +49,29 @@ jobs:
4949
with:
5050
name: CCExtractor Linux build
5151
path: ./linux/artifacts
52+
build_shell_migrations:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Install dependencies
56+
run: sudo apt update && sudo apt-get install libgpac-dev libtesseract-dev libavcodec-dev libavdevice-dev libx11-dev libxcb1-dev libxcb-shm0-dev
57+
- uses: actions/checkout@v6
58+
- name: build
59+
run: ./build -hardsubx
60+
working-directory: ./linux
61+
- name: Display version information
62+
run: ./ccextractor --version
63+
working-directory: ./linux
64+
- name: Prepare artifacts
65+
run: mkdir ./linux/artifacts
66+
- name: Copy release artifact
67+
run: cp ./linux/ccextractor ./linux/artifacts/
68+
# NOTE: The sample-platform test runner (CCExtractor/sample-platform)
69+
# matches artifact names exactly. Update Artifact_names in
70+
# mod_ci/controllers.py there if you rename this artifact.
71+
- uses: actions/upload-artifact@v7
72+
with:
73+
name: CCExtractor Linux build (with migrations)
74+
path: ./linux/artifacts
5275
build_autoconf:
5376
runs-on: ubuntu-latest
5477
steps:

linux/build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ while [[ $# -gt 0 ]]; do
2424
BLD_LINKER="$BLD_LINKER -lswscale -lavutil -pthread -lavformat -lavcodec -lavfilter -lxcb-shm -lxcb -lX11 -llzma -lswresample"
2525
shift
2626
;;
27+
-min-rust)
28+
MIN_RUST=true
29+
BLD_FLAGS="$BLD_FLAGS -DDISABLE_RUST"
30+
shift
31+
;;
2732
-system-libs)
2833
USE_SYSTEM_LIBS=true
2934
shift

src/lib_ccx/ts_tables_epg.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,24 @@ void EPG_free(struct lib_ccx_ctx *ctx)
16301630
{
16311631
if (ctx->epg_inited)
16321632
{
1633+
// Flush any pending EIT sections not triggered by a subsequent
1634+
// payload_start_indicator packet (e.g. last section in stream)
1635+
for (int i = 0; i <= 0xfff; i++)
1636+
{
1637+
if (ctx->epg_buffers[i].buffer != NULL && ctx->epg_buffers[i].ccounter > 0)
1638+
{
1639+
if (ctx->epg_buffers[i].buffer_length > 0)
1640+
{
1641+
unsigned char pointer_field = (unsigned char)ctx->epg_buffers[i].buffer[0];
1642+
if ((size_t)pointer_field + 1 < (size_t)ctx->epg_buffers[i].buffer_length)
1643+
{
1644+
EPG_parse_table(ctx, ctx->epg_buffers[i].buffer, ctx->epg_buffers[i].buffer_length);
1645+
}
1646+
}
1647+
free(ctx->epg_buffers[i].buffer);
1648+
ctx->epg_buffers[i].buffer = NULL;
1649+
}
1650+
}
16331651
if (ccx_options.xmltv == 2 || ccx_options.xmltv == 3 || ccx_options.send_to_srv)
16341652
{
16351653
if (ccx_options.send_to_srv)

0 commit comments

Comments
 (0)