Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Refactor: Move demuxer-related options from global ccx_options to ccx_demuxer struct

Open
#2,101 1 comment 0 reactions 0 assignees View on GitHub

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

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_stream
  • ccx_options.buffer_input
  • ccx_options.input_source
  • ccx_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_ccx harder to use as a standalone library.

Proposed Solution

  • Add live_stream, buffer_input, input_source, and binary_concat fields to struct ccx_demuxer.
  • Initialize these fields from ccx_options during demuxer initialization (e.g., in init_demuxer()).
  • Update affected functions to read configuration from the demuxer context (ctx->) instead of the global ccx_options.

Affected Files

  • src/lib_ccx/ccx_demuxer.h
  • src/lib_ccx/ccx_demuxer.c
  • src/lib_ccx/file_functions.c
Dominant language
C
Stars
901
Forks
592
Avg merge
7d 23h
Merged PRs (30d)
11

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CCExtractor/ccextractor

All issues in CCExtractor/ccextractor

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.