mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-16 13:35:45 +00:00
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/1791
Author: @cfsmp3
Created: 12/12/2025
Status: ✅ Merged
Merged: 12/13/2025
Merged by: @cfsmp3
Base:
master← Head:fix/1776-scc-position-codes📝 Commits (2)
60aa30ffix(scc): Always emit position codes at start of caption (fixes #1776)e412392fix(rust): Remove unused assignments to fix clippy warnings📊 Changes
2 files changed (+4 additions, -5 deletions)
View changed files
📝
src/lib_ccx/ccx_encoders_scc.c(+4 -2)📝
src/rust/src/decoder/tv_screen.rs(+0 -3)📄 Description
Summary
Fixes #1776 - SCC output was omitting line position instructions (PAC codes) that were correctly included in G608 output.
Problem
The SCC encoder in
ccx_encoders_scc.cwas initializing tracking variables as:The encoder only writes position codes (PAC) when it detects a change in row/column/font/color:
The bug: When caption content started at row 14 (the last row, "row 15" in 1-indexed terms), column 0, all four conditions evaluated to
false:current_row (14) != row (14)→ falsecurrent_column (0) != column (0)→ falseThis caused the position code (e.g.,
9470/{1500}) to be completely omitted from the output.Solution
Initialize
current_rowandcurrent_columntoUINT8_MAX(255), which is an impossible value that will never match any valid row (0-14) or column (0-31). This ensures the position code is always written for the first character of each caption.Testing
Tested with a sample MPEG-TS file (
ANDE.ts, ~200MB) containing CEA-608 captions.Before fix (6 instances with missing position codes):
Note:
9420is RCL (Resume Caption Loading), immediately followed by text data without any position code.After fix (position code
9470now present):The
9470code is the PAC (Preamble Address Code) for row 15, column 0 - exactly what was reported missing in #1776.Test methodology
ccextractor ANDE.ts --out=scc -o before_fix.sccccextractor ANDE.ts --out=scc -o after_fix.sccdiff before_fix.scc after_fix.sccFiles changed
src/lib_ccx/ccx_encoders_scc.c- Changed initialization ofcurrent_rowandcurrent_columnfrom14/0toUINT8_MAX/UINT8_MAX🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.