mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-07-08 18:06:30 +00:00
[PR #1868] [MERGED] fix(windows): Prevent CEA-708 output file truncation on Windows #2641
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/1868
Author: @cfsmp3
Created: 12/20/2025
Status: ✅ Merged
Merged: 12/21/2025
Merged by: @cfsmp3
Base:
master← Head:fix/windows-708-file-truncation📝 Commits (1)
49b6982fix(windows): Prevent CEA-708 output file truncation on Windows📊 Changes
1 file changed (+34 additions, -14 deletions)
View changed files
📝
src/rust/src/decoder/tv_screen.rs(+34 -14)📄 Description
Summary
Fixes #1449 - Windows v0.94 truncates 708 CC output file to last subtitle.
On Windows, when processing MP4/MOV files with CEA-708 captions (using
--service), all subtitles were correctly written during processing, but then the file was truncated to only contain the last subtitle at the end.Root cause:
open()and stores the file descriptor inwriter->fdccxr_flush_decoderis calledwriter->fhandle(a separate Windows-specific field)fhandlewas never set by C code (onlyfdwas set), Rust sees it as nullFile::create()which truncates the existing fileThe fix:
fdis already validfd >= 0, convert it to a Windows handle using_get_osfhandle()Why this wasn't caught by CI/Sample Platform
dtvcc_process_data()function directly--serviceflag to extract CEA-708 from MP4 files on WindowsTest plan
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.