[PR #1918] [MERGED] fix: Apply --delay option to DVB/bitmap subtitles #2710

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

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1918
Author: @cfsmp3
Created: 12/28/2025
Status: Merged
Merged: 12/28/2025
Merged by: @cfsmp3

Base: masterHead: fix/issue-1248-delay-option-for-dvb-subtitles


📝 Commits (1)

  • a6ccf29 fix: Apply --delay option to DVB/bitmap subtitles

📊 Changes

1 file changed (+22 additions, -0 deletions)

View changed files

📝 src/lib_ccx/ccx_encoders_common.c (+22 -0)

📄 Description

Summary

The --delay option was not being applied to DVB and other bitmap-based subtitles (DVD subtitles, etc.), only to CEA-608 subtitles. This made it impossible for users to correct timing offsets in DVB subtitle extraction.

Changes

  • Add subs_delay to sub->start_time and sub->end_time for CC_BITMAP subtitles in encode_sub(), matching the behavior for CC_608
  • Add bounds checking to skip subtitles that become negative after applying a negative delay
  • Properly free bitmap data when skipping to avoid memory leaks

Background

Investigation of issue #1248 revealed that while the original timing offset issue (6600ms too early) in certain DVB streams requires the sample file for root cause analysis, the --delay option should have been a viable workaround. However, the delay was never actually applied to bitmap-based subtitles.

In encode_sub() at ccx_encoders_common.c:

  • For CC_608 subtitles: subs_delay was correctly applied
  • For CC_BITMAP subtitles: subs_delay was never applied

Test plan

  • Build passes
  • Verify --delay option works with DVB subtitles
  • Verify negative delays properly skip early subtitles without memory leaks

Fixes #1248 (provides workaround via --delay)

🤖 Generated with Claude Code


🔄 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/1918 **Author:** [@cfsmp3](https://github.com/cfsmp3) **Created:** 12/28/2025 **Status:** ✅ Merged **Merged:** 12/28/2025 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix/issue-1248-delay-option-for-dvb-subtitles` --- ### 📝 Commits (1) - [`a6ccf29`](https://github.com/CCExtractor/ccextractor/commit/a6ccf29630caba87b3044feedff8081a63b7cb60) fix: Apply --delay option to DVB/bitmap subtitles ### 📊 Changes **1 file changed** (+22 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/lib_ccx/ccx_encoders_common.c` (+22 -0) </details> ### 📄 Description ## Summary The `--delay` option was not being applied to DVB and other bitmap-based subtitles (DVD subtitles, etc.), only to CEA-608 subtitles. This made it impossible for users to correct timing offsets in DVB subtitle extraction. ## Changes - Add `subs_delay` to `sub->start_time` and `sub->end_time` for `CC_BITMAP` subtitles in `encode_sub()`, matching the behavior for `CC_608` - Add bounds checking to skip subtitles that become negative after applying a negative delay - Properly free bitmap data when skipping to avoid memory leaks ## Background Investigation of issue #1248 revealed that while the original timing offset issue (6600ms too early) in certain DVB streams requires the sample file for root cause analysis, the `--delay` option should have been a viable workaround. However, the delay was never actually applied to bitmap-based subtitles. In `encode_sub()` at `ccx_encoders_common.c`: - For `CC_608` subtitles: `subs_delay` was correctly applied - For `CC_BITMAP` subtitles: `subs_delay` was **never applied** ## Test plan - [ ] Build passes - [ ] Verify `--delay` option works with DVB subtitles - [ ] Verify negative delays properly skip early subtitles without memory leaks ## Related Issues Fixes #1248 (provides workaround via `--delay`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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:23:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2710