-
Notifications
You must be signed in to change notification settings - Fork 512
Automatic extraction of multiple DVB subtitle streams (--split-dvb-subs) fixes#447 #1864 #1912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Fixed NULL pointer dereference in dvb_subtitle_decoder.c (sub->prev check). - Corrected logic in dvbsub_handle_display_segment to prevent dropped subtitles. - Implemented robust encoder context swapping in general_loop.c for DVB streams. - Added regression test: tests/regression/dvb_split.txt. - Verified 100% completion in split mode and correct Teletext/DVB routing.
… (kept both split_dvb_subs and scc_framerate)
- Fix escaped newline in debug print (dvb_subtitle_decoder.c:1861) - Replace hardcoded PID 0x106 with 0 in debug calls (lines 1822, 1835) - Accept uppercase letters in language code validation (ts_tables.c:396)
cfsmp3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this feature! I tested it with actual DVB samples:
Sample 1: 04e47919de5908edfa1fddc522a811d56bc67a1d4020f8b3972709e25b15966c.ts (3 DVB subtitle streams: CHI, ENG, CHS)
- Legacy mode (no flag): ✅ Works
--split-dvb-subs: ❌ Crashes with "PES data packet larger than remaining buffer" error at ~63%
Sample 2: 36d5eca53c56ac18e727badec449ac0f10096369f8a7eda5f7108f7170c5cc8c.mpg (2 DVB subtitle streams)
- Legacy mode: ✅ Works
--split-dvb-subs: Runs but outputs both streams to a single_unk.srtfile instead of separate files
Please investigate:
- The crash on the 3-stream sample
- Why streams aren't being split into separate files with language tags (the log shows "lang=unk" for both PIDs)
Also, please update CHANGES.TXT for this new feature.
|
Thanks for the detailed review and for testing this. I’ll proceed with investigating the reported issues on my side and follow up with an update. |
…actor#447 - Replace spin-lock with proper mutex (CRITICAL_SECTION/pthread_mutex) - Add per-pipeline OCR contexts for thread safety - Include PID in output filenames to handle duplicate languages - Add dvbsub_get_context_size() and dvbsub_copy_context() for state management - Improve language code validation (ISO 639-2 compliant) - Change fatal error to warning for oversized PES packets - Better language lookup from potential_streams before cinfo fallback - Reset potential_stream data in demuxer cleanup
Fixes segmentation fault at 99% when PAT changes occur during DVB subtitle processing. The crash happened because decoder context private_data was freed but still accessed. Changes: - Add NULL check in process_data() before dvbsub_decode call - Add defensive NULL check at start of dvbsub_decode() - Add defensive NULL check at start of write_dvb_sub() - Deep copy DVB bitmap data in copy_subtitle() to avoid aliasing - Safe DVBSubContext copy that doesn't alias linked list pointers - Clean up pipeline decoder refs in dinit_cap() after PAT change - Direct FTS calculation for DVB-only streams Tested with 11GB TS file with 23 PAT changes - no crash.
…tion After PAT changes, the pipeline's decoder was NULLed out to prevent crashes, but this caused all subsequent DVB data to be skipped. Now the decoder is reinitialized when detected as NULL, allowing subtitle extraction to continue across PAT changes.
Resolves conflicts while preserving Issue CCExtractor#447 fix for DVB multi-stream handling: - Kept DVB metadata update logic in ts_tables.c for split mode - Adapted to upstream's single-param dvbsub_init_decoder signature - Updated lib_ccx.c and general_loop.c to match new API
- Run clang-format on all source files to fix CI formatting check - Add Issue CCExtractor#447 DVB multi-stream feature to CHANGES.TXT
…uption The start_credits_text and end_credits_text pointers were being copied directly from the encoder config options, but free_encoder_context() would later free them. This caused memory corruption when the pointers referred to memory owned by ccx_options. Now these strings are deep-copied in init_encoder() so each encoder context owns its own copy, fixing the --startcreditstext regression.
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 64ce4ac...:
Your PR breaks these cases:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 64ce4ac...:
Congratulations: Merging this PR would fix the following tests:
All tests passed completely. Check the result page for more info. |
In raising this pull request, I confirm the following (please check boxes):
I have read and understood the contributors guide
.
.
My familiarity with the project is as follows (check one):
Summary
This PR completes verification of Issue #447 and applies a few small but necessary fixes identified during review. The --split-dvb-subs feature is confirmed to work correctly with real DVB broadcast samples.
Key points
Verified multi-stream DVB subtitle extraction end-to-end using a real broadcast TS.
Applied 3 minor code-review fixes:
Test sample clarification
https://tsduck.io/streams/france-dttv/tnt-uhf30-546MHz-2019-01-22.ts
Expected / observed behavior:
Results:
Related issue
Fixes and verification for Issue #447.