Skip to content

[FIX] chore: remove two dead includes flagged by clangd - #2329

Open
kaihere14 wants to merge 1 commit into
CCExtractor:masterfrom
kaihere14:fix/remove-dead-includes
Open

[FIX] chore: remove two dead includes flagged by clangd#2329
kaihere14 wants to merge 1 commit into
CCExtractor:masterfrom
kaihere14:fix/remove-dead-includes

Conversation

@kaihere14

Copy link
Copy Markdown
Contributor

ccx_common_char_encoding.h in ccx_decoders_common.c is unused — the functions it declares moved to ccx_encoders_common.c after a 2014 refactor and the include was never cleaned up.

ccx_demuxer_mxf.h in general_loop.c is also unused — general_loop.c handles MXF via ccx_mxf_getmoredata, which is already declared in lib_ccx.h (included separately). This header appears to have been added by reflex alongside MXF support in 2017 without ever being needed.

A third flagged include, ffmpeg_intgr.h in general_loop.c, was investigated and left untouched — it's a genuine dependency under #ifdef ENABLE_FFMPEG (used at general_loop.c:1418), invisible to clangd's default indexing since that flag isn't set during static analysis.

Closes #2328

In raising this pull request, I confirm the following (please check boxes):

Reason for this PR:

  • This PR adds new functionality.
  • This PR fixes a bug that I have personally experienced or that a real user has reported and for which a sample exists.
  • This PR is porting code from C to Rust.

Sanity check:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • If the PR adds new functionality, I've added it to the changelog. If it's just a bug fix, I have NOT added it to the changelog.
  • I am NOT adding new C code unless it's to fix an existing, reproducible bug.

Repro instructions

This isn't a crash-reproducing bug fix, it's a dead-code cleanup, so "reproduction" here means verifying the includes are genuinely unused and that removing them changes nothing functionally.

To reproduce the original finding:

  1. Run clangd's unused-includes check (or open src/lib_ccx/ccx_decoders_common.c and src/lib_ccx/general_loop.c in an IDE with clangd enabled)
  2. It flags ccx_common_char_encoding.h (ccx_decoders_common.c:6) and ccx_demuxer_mxf.h (general_loop.c:20) as included but not directly used

To verify each finding before this PR:

  • grep -n "get_char_in_latin_1\|get_char_in_unicode\|get_char_in_utf_8\|cctolower\|cctoupper" src/lib_ccx/ccx_decoders_common.c returns nothing
  • grep -n "ccx_probe_mxf\|ccx_mxf_init\|MXFTrack\|MXFContext" src/lib_ccx/general_loop.c returns nothing
  • git log -p --follow src/lib_ccx/ccx_decoders_common.c around commit 301c2a71 shows the original functions that needed this header, and shows they've since moved to ccx_encoders_common.c
  • git log -p --follow src/lib_ccx/general_loop.c around commit 42ab1640 ("Add MXF support") shows ccx_demuxer_mxf.h was added alongside the CCX_SM_MXF case, but the actual function used (ccx_mxf_getmoredata) is declared in lib_ccx.h, already included separately

To verify this PR doesn't break anything:

  1. Build before this change: cmake --build build (or the standard project build)
  2. Build after this change with the two includes removed
  3. Both builds should succeed identically — no compile errors, since nothing in either file references anything from the removed headers

No functional or behavioral change; only the two confirmed-dead includes are removed.

ccx_common_char_encoding.h in ccx_decoders_common.c is unused —
the functions it declares moved to ccx_encoders_common.c after a
2014 refactor and the include was never cleaned up.

ccx_demuxer_mxf.h in general_loop.c is also unused — general_loop.c
handles MXF via ccx_mxf_getmoredata, which is already declared in
lib_ccx.h (included separately). This header appears to have been
added by reflex alongside MXF support in 2017 without ever being
needed.

A third flagged include, ffmpeg_intgr.h in general_loop.c, was
investigated and left untouched — it's a genuine dependency under

Closes CCExtractor#2328
@kaihere14

Copy link
Copy Markdown
Contributor Author

Hey @cfsmp3, small cleanup PR whenever you have a sec. Two dead includes, verified, no functional change

@ccextractor-bot

Copy link
Copy Markdown
Collaborator
CCExtractor CI platform finished running the test files on linux. 167/237 tests matched the approved output:
Report Name Tests Passed
Broken 9/13
CEA-708 2/14
DVB 0/7
DVD 3/3
DVR-MS 2/2
General 22/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 69/86
Teletext 0/21
WTV 12/13
XDS 31/34

70 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 mastertest 9499, commit 3af3fc2:

  • 0 pass there and fail here
  • 0 fail there and pass here
  • 0 fail on both, with different output
  • 70 fail on both, byte for byte the same

Compared with the commit this branch was cut from: the same run as the tip of master (test 9499), 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-bot

Copy link
Copy Markdown
Collaborator
CCExtractor CI platform finished running the test files on windows. 167/237 tests matched the approved output:
Report Name Tests Passed
Broken 9/13
CEA-708 2/14
DVB 0/7
DVD 3/3
DVR-MS 2/2
General 22/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 69/86
Teletext 0/21
WTV 12/13
XDS 31/34

70 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 mastertest 9495, commit 3af3fc2:

  • 1 pass there and fail here
  • 0 fail there and pass here
  • 0 fail on both, with different output
  • 69 fail on both, byte for byte the same

Pass there, fail here:


Compared with the commit this branch was cut from: the same run as the tip of master (test 9495), so the comparison above already covers it.


This branch changes the behaviour of 1 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CLEANUP] Two dead includes in ccx_decoders_common.c and general_loop.c

2 participants