Refactor: Move demuxer-related options from global ccx_options to ccx_demuxer struct
Maintainers usually reply within 1 day
@ansh27singh is already working on this.
Since Feb 21, 2026.
- #2102 by @AhmedAlian7 — closed without merging
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- c
- Domain
- audio-video-rtc
Research direction
Start with struct ccx_demuxer in src/lib_ccx/ccx_demuxer.h and its initialization in src/lib_ccx/ccx_demuxer.c. Trace init_demuxer() and the affected functions in src/lib_ccx/file_functions.c, then verify that the four options are initialized on the demuxer and no longer read from global ccx_options there.
Written by the indexing model from the issue text.
Description
Problem
Several functions in src/lib_ccx/file_functions.c rely on the global ccx_options struct for configuration values, specifically:
ccx_options.live_streamccx_options.buffer_inputccx_options.input_sourceccx_options.binary_concat
This creates tight coupling between the demuxer logic and global application state.
Current Behavior
Functions such as:
buffered_read_opt()switch_to_next_file()ccx_demuxer_open()ccx_demuxer_close()
directly access the global ccx_options struct instead of receiving configuration through the demuxer context.
Why This Is Problematic
- Testability — Functions relying on globals are difficult to unit test in isolation.
- Encapsulation — The demuxer's behavior depends on external state it does not own.
- Thread safety — Global state increases the risk of race conditions in multi-threaded scenarios.
- Library reuse — Tight coupling makes
lib_ccxharder to use as a standalone library.
Proposed Solution
- Add
live_stream,buffer_input,input_source, andbinary_concatfields tostruct ccx_demuxer. - Initialize these fields from
ccx_optionsduring demuxer initialization (e.g., ininit_demuxer()). - Update affected functions to read configuration from the demuxer context (
ctx->) instead of the globalccx_options.
Affected Files
src/lib_ccx/ccx_demuxer.hsrc/lib_ccx/ccx_demuxer.csrc/lib_ccx/file_functions.c
- Dominant language
- C
- Stars
- 901
- Forks
- 592
- Avg merge
- 7d 23h
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CCExtractor/ccextractor
-
[BUG] Legacy options -608, -708, -90090, -UCLA, -CC2, -LF, -DF, -parsepat, -parsepmt still rejected after #1856Possibly taken @Deepak-negi11 claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
CCExtractor/ccextractor#2367 ·
Maintainers usually reply within 1 day
-
[BUG] Memory leak in free_sub_track(): blockaddition and message buffer never freed for WebVTT tracksPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 86/100
CCExtractor/ccextractor#2247 ·
Maintainers usually reply within 1 day
-
`--out=mcc`: CDP cc_count field overflows above 31 triplets; uint8 `data_size` corrupts lengths and over-reads at higher countsPossibly taken @kaihere14 claimed this 9 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 72/100
CCExtractor/ccextractor#2365 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 68/100
CCExtractor/ccextractor#2358 · 1 comment ·
Maintainers usually reply within 1 day
-
--tpages-all extracts less than --tpagePossibly taken @SajalDevX claimed this 17 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 65/100
CCExtractor/ccextractor#2355 ·
Maintainers usually reply within 1 day
All issues in CCExtractor/ccextractor
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
KalicoCrew/kalico#1012 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
joncampbell123/dosbox-x#6664 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
bug good first issue please retest
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
eclipse-tinydtls/tinydtls#298 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100