[PR #2009] fix(ts): allow manual streamtype override for private streams #2815

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

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/2009
Author: @pulk17
Created: 1/10/2026
Status: 🔄 Open

Base: masterHead: fix/ts-private-stream-override


📝 Commits (3)

  • 6dcb605 fix(ts): allow manual streamtype override for private streams
  • cfbf89f style: fix indentation (clang-format)
  • cf8f91c Empty commit to rerun ci/cd tests

📊 Changes

1 file changed (+7 additions, -3 deletions)

View changed files

📝 src/lib_ccx/ts_tables.c (+7 -3)

📄 Description

[FIX] ts: Allow manual streamtype override for private streams causing fatal errors

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.

Summary

Fixed a logic bug in ts_tables.c where the parser would trigger a fatal error ("I can't tell the stream type") for private streams (0x80-0xFF), even if the user explicitly provided --streamtype.

The Issue

When parsing a PMT with private streams (common in M2TS files with PGS subtitles), the code checks if the stream type is private and immediately exits with a fatal error requesting manual selection.

The error logic failed to check if ccx_options.demux_cfg.ts_forced_streamtype was already set by the user via the CLI arguments. This made it impossible to force-read private streams, as the application would crash before applying the user's override.

The Fix

Added a check to verify if the user has already manually set the stream type (via --streamtype).

  • If the user has provided a type, the fatal error is skipped, a verbose message is logged ("User manually set stream type..."), and the parser proceeds using the user-supplied value.
  • If the user has not provided a type, the fatal error triggers as intended.

Verification

Tested with hitman_cut.m2ts (a sample with missing PMT/Private Stream) and 00000.m2ts (PGS streams).

Command:
ccextractor input.m2ts --datapid 4608 --streamtype 6

  • Before:
Screenshot 2026-01-10 192702
  • After:
Screenshot 2026-01-10 194020

🔄 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/2009 **Author:** [@pulk17](https://github.com/pulk17) **Created:** 1/10/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/ts-private-stream-override` --- ### 📝 Commits (3) - [`6dcb605`](https://github.com/CCExtractor/ccextractor/commit/6dcb605420ed4037295ab59b9f752dfbdc1627bf) fix(ts): allow manual streamtype override for private streams - [`cfbf89f`](https://github.com/CCExtractor/ccextractor/commit/cfbf89f829c9ffea54e6cbbbae2a3a53da1bc64f) style: fix indentation (clang-format) - [`cf8f91c`](https://github.com/CCExtractor/ccextractor/commit/cf8f91c8395197aa563712ddfe305ae7fcc67f8c) Empty commit to rerun ci/cd tests ### 📊 Changes **1 file changed** (+7 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/lib_ccx/ts_tables.c` (+7 -3) </details> ### 📄 Description [FIX] ts: Allow manual streamtype override for private streams causing fatal errors **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. - [ ] **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. - [x] I absolutely love CCExtractor, but have not contributed previously. - [ ] I am an active contributor to CCExtractor. --- ### Summary Fixed a logic bug in `ts_tables.c` where the parser would trigger a fatal error ("I can't tell the stream type") for private streams (0x80-0xFF), even if the user explicitly provided `--streamtype`. ### The Issue When parsing a PMT with private streams (common in M2TS files with PGS subtitles), the code checks if the stream type is private and immediately exits with a fatal error requesting manual selection. The error logic failed to check if `ccx_options.demux_cfg.ts_forced_streamtype` was already set by the user via the CLI arguments. This made it impossible to force-read private streams, as the application would crash before applying the user's override. ### The Fix Added a check to verify if the user has already manually set the stream type (via `--streamtype`). * If the user **has** provided a type, the fatal error is skipped, a verbose message is logged ("User manually set stream type..."), and the parser proceeds using the user-supplied value. * If the user **has not** provided a type, the fatal error triggers as intended. ### Verification Tested with `hitman_cut.m2ts` (a sample with missing PMT/Private Stream) and `00000.m2ts` (PGS streams). **Command:** `ccextractor input.m2ts --datapid 4608 --streamtype 6` * **Before:** <img width="1086" height="203" alt="Screenshot 2026-01-10 192702" src="https://github.com/user-attachments/assets/0d8b48ee-b4c5-49f7-b7ce-5ef3bb48bc73" /> * **After:** <img width="1151" height="475" alt="Screenshot 2026-01-10 194020" src="https://github.com/user-attachments/assets/cbcddd58-b474-49a2-8a2f-b6863399b098" /> --- <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:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2815