mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #1974] fix(rust): Flush stdout after print to fix stream mode display #2776
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/1974
State: closed
Merged: Yes
Summary
[Stream mode: ]display when using--input <format>optionsProblem
When using
--input scc(or other formats), the startup output showed:Instead of:
Root Cause
The Rust logger's
print()function usesprint!()which doesn't automatically flush stdout. When mixing C and Rust code that both write to stdout, the Rust output was getting buffered and not appearing before the C code continued writing.Solution
Added explicit
std::io::stdout().flush()after eachprint!()call to ensure output appears immediately and interleaves correctly with C code.Test plan
--input sccshows[Stream mode: SCC]--input mkvshows[Stream mode: MKV]--input tsshows[Stream mode: Transport][Stream mode: Autodetect]🤖 Generated with Claude Code