Skip to content

Conversation

@cfsmp3
Copy link
Contributor

@cfsmp3 cfsmp3 commented Jan 2, 2026

Summary

  • Fixes empty [Stream mode: ] display when using --input <format> options
  • Adds explicit stdout/stderr flush after print operations in Rust logger

Problem

When using --input scc (or other formats), the startup output showed:

[Stream mode: ]

Instead of:

[Stream mode: SCC]

Root Cause

The Rust logger's print() function uses print!() 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 each print!() call to ensure output appears immediately and interleaves correctly with C code.

Test plan

  • --input scc shows [Stream mode: SCC]
  • --input mkv shows [Stream mode: MKV]
  • --input ts shows [Stream mode: Transport]
  • Autodetect shows [Stream mode: Autodetect]
  • All 265 Rust tests pass

🤖 Generated with Claude Code

When using --input <format>, the startup output showed [Stream mode: ]
(empty) instead of showing the format name like [Stream mode: SCC].

Root cause: The Rust logger's print() function uses print!() 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.

The fix adds explicit std::io::stdout().flush() after each print!()
call to ensure output appears immediately and interleaves correctly
with C code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 8aadbfb...:
Report Name Tests Passed
Broken 13/13
CEA-708 14/14
DVB 6/7
DVD 3/3
DVR-MS 2/2
General 27/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 86/86
Teletext 21/21
WTV 13/13
XDS 34/34

NOTE: The following tests have been failing on the master branch as well as the PR:


This PR does not introduce any new test failures. However, some tests are failing on both master and this PR (see above).

Check the result page for more info.

@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 8aadbfb...:
Report Name Tests Passed
Broken 13/13
CEA-708 14/14
DVB 7/7
DVD 3/3
DVR-MS 2/2
General 27/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 86/86
Teletext 21/21
WTV 13/13
XDS 34/34

All tests passed completely.

Check the result page for more info.

@cfsmp3 cfsmp3 merged commit cfa7d91 into master Jan 3, 2026
41 checks passed
@cfsmp3 cfsmp3 deleted the fix/stream-mode-display-flush branch January 3, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants