Skip to content

fix(608): only apply pop-on→roll-up EOF fallback when start time is unset#2291

Open
x15sr71 wants to merge 1 commit into
CCExtractor:masterfrom
x15sr71:fix/608-rollup-eof-fallback-guard
Open

fix(608): only apply pop-on→roll-up EOF fallback when start time is unset#2291
x15sr71 wants to merge 1 commit into
CCExtractor:masterfrom
x15sr71:fix/608-rollup-eof-fallback-guard

Conversation

@x15sr71

@x15sr71 x15sr71 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

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

Reason for this PR:

  • This PR adds new functionality.
  • This PR fixes a bug that I have personally experienced or that a real user has reported and for which a sample exists.
  • This PR is porting code from C to Rust.

Sanity check:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • If the PR adds new functionality, I've added it to the changelog. If it's just a bug fix, I have NOT added it to the changelog.
  • I am NOT adding new C code unless it's to fix an existing, reproducible bug.

Repro instructions:

This PR fixes Regression Test 11, which fails on master on both Windows and Linux. On Linux, it currently shows a separate “No output generated but there should be” issue that is still under investigation; Reference test run - Windows, Linux.


Problem

A 608 regression caused incorrect cue start times on a WTV sample, while subtitle text and end times remained correct.

Root cause

689b27ce added an EOF fallback for pop-on -> roll-up transitions by back-filling current_visible_start_ms from ts_first_char_rollup_transition.

That fallback was too broad: if rollup_from_popon was still set when write_cc_buffer() ran, it could overwrite an already valid current_visible_start_ms with the first-character FTS.

Fix

Only apply the EOF fallback when current_visible_start_ms is still unset:

if (context->rollup_from_popon &&
    context->ts_first_char_rollup_transition > 0 &&
    context->current_visible_start_ms <= 0)

This keeps the EOF fix from 689b27ce while avoiding clobbering valid cue start times on normal paths.

Testing

  • Reproduced the regression on the affected WTV sample - 611b4a9235c08....
  • Applied the guard above in write_cc_buffer().
  • Rebuilt CCExtractor and compared the generated SRT against the reference file.
  • Verified that the diff between current output and the reference file (2af8168380d0...) is clean.

@ccextractor-bot

Copy link
Copy Markdown
Collaborator
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 2feb09a...:
Report Name Tests Passed
Broken 10/13
CEA-708 2/14
DVB 1/7
DVD 3/3
DVR-MS 2/2
General 23/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 72/86
Teletext 20/21
WTV 13/13
XDS 31/34

Your PR breaks these cases:

  • ccextractor --autoprogram --out=ttxt --latin1 1020459a86...
  • ccextractor --autoprogram --out=srt --latin1 --quant 0 85271be4d2...
  • ccextractor --autoprogram --out=ttxt --latin1 99e5eaafdc...
  • ccextractor --autoprogram --out=ttxt --latin1 --ucla dab1c1bd65...
  • ccextractor --autoprogram --out=ttxt --latin1 01509e4d27...
  • ccextractor --out=srt --latin1 --autoprogram 29e5ffd34b...
  • ccextractor --out=spupng c83f765c66...
  • ccextractor --dru c83f765c66...
  • ccextractor --startat 4 --endat 7 c83f765c66...
  • ccextractor --codec dvbsub --out=spupng 85271be4d2...
  • ccextractor --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsnotbefore 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsnotafter 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsforatleast 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsforatmost 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --autoprogram --out=srt --latin1 --ucla d037c7509e...
  • ccextractor --autoprogram --out=srt --latin1 --ucla 7d3f25c32c...
  • ccextractor --autoprogram --out=ttxt --latin1 --ucla --xds 7f41299cc7...

NOTE: The following tests have been failing on the master branch as well as the PR:

Congratulations: Merging this PR would fix the following tests:

  • ccextractor --service 1 --out=ttxt da904de35d..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 132d7df7e9..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 b22260d065..., Last passed: Never

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants