fix(ts): allow manual streamtype override for private streams #2009
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[FIX] ts: Allow manual streamtype override for private streams causing fatal errors
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Summary
Fixed a logic bug in
ts_tables.cwhere 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_streamtypewas 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).Verification
Tested with
hitman_cut.m2ts(a sample with missing PMT/Private Stream) and00000.m2ts(PGS streams).Command:
ccextractor input.m2ts --datapid 4608 --streamtype 6