Skip to content

[FIX] transcript: suppress spurious blank lines from write_cc_line_as_transcript2 - #2324

Open
x15sr71 wants to merge 1 commit into
CCExtractor:masterfrom
x15sr71:fix/transcript-blank-line
Open

[FIX] transcript: suppress spurious blank lines from write_cc_line_as_transcript2#2324
x15sr71 wants to merge 1 commit into
CCExtractor:masterfrom
x15sr71:fix/transcript-blank-line

Conversation

@x15sr71

@x15sr71 x15sr71 commented Aug 13, 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:

Run with --autoprogram --out=ttxt --latin1 on any sample with a pop-on → roll-up mode transition. The output contains one or more spurious blank lines not present in the reference file. Confirmed on the sample platform via RT41, RT84, RT11, RT29, RT30.


Issue:

write_cc_buffer_as_transcript2 emits spurious blank lines in --out=ttxt output on samples with pop-on → roll-up transitions.

Root cause:

Introduced in PR #2105 - it refactored write_cc_buffer_as_transcript2 to emit encoded_end_frame after each block, and changed the call to:

write_cc_line_as_transcript2(data, context, i);
wrote_something = 1;   // unconditional

Because write_cc_line_as_transcript2 returned void, the caller couldn't know it wrote nothing (blank cursor row). wrote_something got set to 1 anyway, so a bare newline was emitted for every empty row.

Fix:

Change write_cc_line_as_transcript2 from void to int (returns 1 if content was written, 0 if not) and use |= in the caller:
wrote_something |= write_cc_line_as_transcript2(data, context, i); encoded_end_frame is now only written when at least one line produced output.

Testing:

  • RT41 (01509...ts, --out=ttxt --latin1): two spurious blank lines removed. Output is byte-identical to accepted variant ref 9f139b8c...

@x15sr71

x15sr71 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

The Docker build (hardsubx) failure is unrelated to this PR — it's a transient Docker Hub auth outage (500 Internal Server Error on auth.docker.io/token). The other two Docker jobs passed in the same run. A re-run should clear it.

@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 128175e...:
Report Name Tests Passed
Broken 9/13
CEA-708 2/14
DVB 1/7
DVD 3/3
DVR-MS 2/2
General 25/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 69/86
Teletext 0/21
WTV 12/13
XDS 32/34

Your PR breaks these cases:

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 --autoprogram --out=srt --latin1 f1422b8bfe..., 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.

@ccextractor-bot

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

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


This PR does not introduce any new test failures. However, some tests are failing on both master and this PR (see above).

Check the result page for more info.

@x15sr71 x15sr71 changed the title [FIX]: transcript: suppress spurious blank lines from write_cc_line_as_transcript2 [FIX] transcript: suppress spurious blank lines from write_cc_line_as_transcript2 Aug 14, 2026
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