Skip to content

[FIX] Write the clearing cue after SAMI credits - #2474

Open
harshalsp07 wants to merge 1 commit into
CCExtractor:masterfrom
harshalsp07:fix/sami-credits-clear
Open

harshalsp07 wants to merge 1 commit into
CCExtractor:masterfrom
harshalsp07:fix/sami-credits-clear

Conversation

@harshalsp07

@harshalsp07 harshalsp07 commented Nov 19, 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.

SAMI start credits end with a duplicate </P></SYNC> because the encoder writes the previous buffer. Encode the timed clearing cue before writing it.

Reproduce with the existing SCC fixture. Sample

build/ccextractor tests/samples/scc_23_976.scc --sami \
  --startcreditstext 'Example credits' \
  --startcreditsforatleast 1 --startcreditsforatmost 2 -o output.smi

The blank cue at 1400 ms clears the credits before the first caption.

<SYNC start=1400><P class="UNKNOWNCC">&nbsp;</P></SYNC>

On Linux, the UTF-8, Latin-1, and UTF-16 regression cases all passed. All three reproduced the missing cue on master.

@cfsmp3 cfsmp3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is Carlos' claude doing the first pass. Before Carlos takes a look, please address these issues.

The one-line fix is right. On master the credits end with </P></SYNC> twice. With this branch the <SYNC start=3500> clearing cue is written. The other write_stringz_as_* writers already encode before writing, so SAMI was the only one affected.

Please remove the CTest/Python additions (src/CMakeLists.txt block, tests/test_cli_sami_credits.py, tests/samples/cli_output.scc):

  • Nothing defines BUILD_TESTING (no include(CTest) / enable_testing()), and CI doesn't run ctest, so the block never runs.
  • In this PR the block loops over CLI_OUTPUT_TESTS, which is never set (the file(GLOB …) line is only in #2472 and #2473), so it would register nothing even with CTest enabled.
  • The same tests/samples/cli_output.scc is added in #2472, #2473 and here, so the three PRs conflict with each other.

Adding a CLI test harness is a separate decision. Please keep this PR to the fix.

@harshalsp07
harshalsp07 force-pushed the fix/sami-credits-clear branch from dbbb753 to acb69d3 Compare November 23, 2026 17:12
@harshalsp07
harshalsp07 force-pushed the fix/sami-credits-clear branch from acb69d3 to 81d9b33 Compare November 24, 2026 04:25
@ccextractor-bot

Copy link
Copy Markdown
Collaborator
CCExtractor CI platform finished running the test files on linux. 171/238 tests matched the approved output:
Report Name Tests Passed
Broken 9/13
CEA-708 2/14
DVB 0/7
DVD 3/3
DVR-MS 2/2
General 26/28
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 68/86
Teletext 0/21
WTV 12/13
XDS 32/34

67 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.


Compared with the tip of master — test 10124, commit 034fdbc:

  • 0 pass there and fail here
  • 0 fail there and pass here
  • 0 fail on both, with different output
  • 67 fail on both, byte for byte the same

Compared with the commit this branch was cut from: the same run as the tip of master (test 10124), so the comparison above already covers it.


No test changes behaviour relative to the tip of master: every failure above fails there too, byte for byte. The approved output for those tests is out of date, which is a baseline to review rather than a regression in this branch.

@ccextractor-bot

Copy link
Copy Markdown
Collaborator
CCExtractor CI platform finished running the test files on windows. 171/238 tests matched the approved output:
Report Name Tests Passed
Broken 9/13
CEA-708 2/14
DVB 0/7
DVD 3/3
DVR-MS 2/2
General 26/28
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 68/86
Teletext 0/21
WTV 12/13
XDS 32/34

67 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.


Compared with the tip of master — test 10125, commit 034fdbc:

  • 0 pass there and fail here
  • 0 fail there and pass here
  • 0 fail on both, with different output
  • 67 fail on both, byte for byte the same

Compared with the commit this branch was cut from: the same run as the tip of master (test 10125), so the comparison above already covers it.


No test changes behaviour relative to the tip of master: every failure above fails there too, byte for byte. The approved output for those tests is out of date, which is a baseline to review rather than a regression in this branch.

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.

3 participants