mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-25 07:29:54 +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?
Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1791
State: closed
Merged: Yes
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