[PR #2051] [CLOSED] feat: implement DVB subtitle splitting (--split-dvb-subs) #2863

Closed
opened 2026-01-29 17:24:18 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/2051
Author: @Rahul-2k4
Created: 1/21/2026
Status: Closed

Base: masterHead: dvb-clean-minimal


📝 Commits (10+)

  • cca3e3c Cleanup: Finalize DVB split feature implementation
  • 7505524 Fix issues identified by CodeRabbit review
  • 042493f Fix clap validation and remove dead unsafe code
  • c6da9db Fix syntax errors and formatting in C files
  • f53026b Fix remaining indentation issues in general_loop.c
  • ac35e84 Fix issues identified by CodeRabbit (Round 2) and repair syntax
  • 394a994 Apply clang-format to C files
  • 0de8a15 Fix build: resolve brace mismatches in general_loop.c and apply clang-format
  • ec9df11 Fix DVB dedup PTS calc, guard process_cc_data in general_loop, and restore rcwt cleanup
  • 8db4939 Apply manual formatting fixes to match CI clang-format

📊 Changes

48 files changed (+2368 additions, -2624 deletions)

View changed files

.github/workflows/build_deb.yml (+0 -283)
.github/workflows/build_deb_debian13.yml (+0 -275)
📝 .github/workflows/build_docker.yml (+0 -4)
📝 .github/workflows/build_linux.yml (+0 -4)
📝 .github/workflows/build_mac.yml (+0 -4)
📝 .github/workflows/build_windows.yml (+0 -4)
📝 docs/CHANGES.TXT (+7 -0)
📝 linux/Makefile.am (+4 -2)
📝 linux/configure.ac (+2 -2)
📝 mac/Makefile.am (+2 -0)
📝 src/CMakeLists.txt (+1 -10)
📝 src/ccextractor.c (+2 -0)
📝 src/lib_ccx/CMakeLists.txt (+13 -6)
📝 src/lib_ccx/ccx_common_option.c (+3 -0)
📝 src/lib_ccx/ccx_common_option.h (+3 -1)
📝 src/lib_ccx/ccx_decoders_common.c (+2 -2)
📝 src/lib_ccx/ccx_decoders_structs.h (+3 -1)
📝 src/lib_ccx/ccx_demuxer.c (+8 -0)
📝 src/lib_ccx/ccx_demuxer.h (+28 -2)
📝 src/lib_ccx/ccx_encoders_common.c (+12 -11)

...and 28 more files

📄 Description

Add multi-stream DVB subtitle extraction feature that allows automatic splitting of DVB subtitle streams into separate output files per language or PID.

New Features:

  • --split-dvb-subs: Extract each DVB stream to a separate file with language suffix (e.g., output_deu.srt, output_fra.srt)
  • --no-dvb-dedup: Disable DVB subtitle deduplication (enabled by default)

Architecture Changes:

  • Added PID tracking to decoder contexts for multi-stream support
  • New stream metadata structures for DVB stream discovery
  • DVB deduplication ring buffer (dvb_dedup.c/h)
  • Language tracking in cap_info structure (ISO 639-2 codes)

Core Implementation:

  • Enhanced DVB decoder with multi-stream pipeline support
  • Demuxer fixes to allow DVB packets in both split and non-split modes
  • Automatic .srt extension handling for output files
  • Per-stream output file generation in lib_ccx.c

Bug Fixes:

  • Fixed demuxer regression for single-stream DVB files
  • Added NULL pointer checks in DVB processing
  • Fixed output filename extension handling

Testing:

  • Verified on 5 DVB samples with expected file counts
  • Multi-stream samples correctly produce 6 files with --split-dvb-subs
  • Single-stream samples work correctly in both modes
  • CEA-708 samples unaffected by DVB changes

Files: 24 changed (1,601 insertions, 264 deletions)

  • 2 new files (dvb_dedup.c/h)
  • 22 modified DVB-related files
  • No build system or unrelated changes included

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

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/2051 **Author:** [@Rahul-2k4](https://github.com/Rahul-2k4) **Created:** 1/21/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `dvb-clean-minimal` --- ### 📝 Commits (10+) - [`cca3e3c`](https://github.com/CCExtractor/ccextractor/commit/cca3e3c898ed2b1212c81d55fb30502dbf8fa651) Cleanup: Finalize DVB split feature implementation - [`7505524`](https://github.com/CCExtractor/ccextractor/commit/750552457186496306ffb350dc6de79ee3b7c993) Fix issues identified by CodeRabbit review - [`042493f`](https://github.com/CCExtractor/ccextractor/commit/042493fdc0d2e4e6efb68a10d2782d36f5d12401) Fix clap validation and remove dead unsafe code - [`c6da9db`](https://github.com/CCExtractor/ccextractor/commit/c6da9db36499bb600905763b32abf2ef3eff65e0) Fix syntax errors and formatting in C files - [`f53026b`](https://github.com/CCExtractor/ccextractor/commit/f53026b601e0cb245e6fe92a92d87f3cd29f3a36) Fix remaining indentation issues in general_loop.c - [`ac35e84`](https://github.com/CCExtractor/ccextractor/commit/ac35e845a8ac9969c81ec417f5a491a0dbc71b92) Fix issues identified by CodeRabbit (Round 2) and repair syntax - [`394a994`](https://github.com/CCExtractor/ccextractor/commit/394a9941c5121b688ed2f4cffcea71d5511e287e) Apply clang-format to C files - [`0de8a15`](https://github.com/CCExtractor/ccextractor/commit/0de8a15cba73434305d6213296137fc43ccc9fb7) Fix build: resolve brace mismatches in general_loop.c and apply clang-format - [`ec9df11`](https://github.com/CCExtractor/ccextractor/commit/ec9df11d15d5b97ae88df7ba018985d9ac7f70d9) Fix DVB dedup PTS calc, guard process_cc_data in general_loop, and restore rcwt cleanup - [`8db4939`](https://github.com/CCExtractor/ccextractor/commit/8db493980725a1db1c0fc4c8c7b7f639597dc0d1) Apply manual formatting fixes to match CI clang-format ### 📊 Changes **48 files changed** (+2368 additions, -2624 deletions) <details> <summary>View changed files</summary> ➖ `.github/workflows/build_deb.yml` (+0 -283) ➖ `.github/workflows/build_deb_debian13.yml` (+0 -275) 📝 `.github/workflows/build_docker.yml` (+0 -4) 📝 `.github/workflows/build_linux.yml` (+0 -4) 📝 `.github/workflows/build_mac.yml` (+0 -4) 📝 `.github/workflows/build_windows.yml` (+0 -4) 📝 `docs/CHANGES.TXT` (+7 -0) 📝 `linux/Makefile.am` (+4 -2) 📝 `linux/configure.ac` (+2 -2) 📝 `mac/Makefile.am` (+2 -0) 📝 `src/CMakeLists.txt` (+1 -10) 📝 `src/ccextractor.c` (+2 -0) 📝 `src/lib_ccx/CMakeLists.txt` (+13 -6) 📝 `src/lib_ccx/ccx_common_option.c` (+3 -0) 📝 `src/lib_ccx/ccx_common_option.h` (+3 -1) 📝 `src/lib_ccx/ccx_decoders_common.c` (+2 -2) 📝 `src/lib_ccx/ccx_decoders_structs.h` (+3 -1) 📝 `src/lib_ccx/ccx_demuxer.c` (+8 -0) 📝 `src/lib_ccx/ccx_demuxer.h` (+28 -2) 📝 `src/lib_ccx/ccx_encoders_common.c` (+12 -11) _...and 28 more files_ </details> ### 📄 Description Add multi-stream DVB subtitle extraction feature that allows automatic splitting of DVB subtitle streams into separate output files per language or PID. New Features: - --split-dvb-subs: Extract each DVB stream to a separate file with language suffix (e.g., output_deu.srt, output_fra.srt) - --no-dvb-dedup: Disable DVB subtitle deduplication (enabled by default) Architecture Changes: - Added PID tracking to decoder contexts for multi-stream support - New stream metadata structures for DVB stream discovery - DVB deduplication ring buffer (dvb_dedup.c/h) - Language tracking in cap_info structure (ISO 639-2 codes) Core Implementation: - Enhanced DVB decoder with multi-stream pipeline support - Demuxer fixes to allow DVB packets in both split and non-split modes - Automatic .srt extension handling for output files - Per-stream output file generation in lib_ccx.c Bug Fixes: - Fixed demuxer regression for single-stream DVB files - Added NULL pointer checks in DVB processing - Fixed output filename extension handling Testing: - Verified on 5 DVB samples with expected file counts - Multi-stream samples correctly produce 6 files with --split-dvb-subs - Single-stream samples work correctly in both modes - CEA-708 samples unaffected by DVB changes Files: 24 changed (1,601 insertions, 264 deletions) - 2 new files (dvb_dedup.c/h) - 22 modified DVB-related files - No build system or unrelated changes included <!-- Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**. --> **In raising this pull request, I confirm the following (please check boxes):** - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that another pull request for this purpose does not exist. - [x] I have considered, and confirmed that this submission will be valuable to others. - [x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [x] I give this submission freely, and claim no ownership to its content. - [x] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).** **My familiarity with the project is as follows (check one):** - [ ] I have never used CCExtractor. - [ ] I have used CCExtractor just a couple of times. - [ ] I absolutely love CCExtractor, but have not contributed previously. - [x] I am an active contributor to CCExtractor. --- --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:24:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2863