fix(rust): Flush stdout after print to fix stream mode display #1974
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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