[PR #1974] [MERGED] fix(rust): Flush stdout after print to fix stream mode display #2772

Open
opened 2026-01-29 17:23:50 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1974
Author: @cfsmp3
Created: 1/2/2026
Status: Merged
Merged: 1/3/2026
Merged by: @cfsmp3

Base: masterHead: fix/stream-mode-display-flush


📝 Commits (1)

  • ad971f0 fix(rust): Flush stdout after print to fix stream mode display

📊 Changes

1 file changed (+10 additions, -2 deletions)

View changed files

📝 src/rust/lib_ccxr/src/util/log.rs (+10 -2)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1974 **Author:** [@cfsmp3](https://github.com/cfsmp3) **Created:** 1/2/2026 **Status:** ✅ Merged **Merged:** 1/3/2026 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix/stream-mode-display-flush` --- ### 📝 Commits (1) - [`ad971f0`](https://github.com/CCExtractor/ccextractor/commit/ad971f0e723ba2a32b47f619903cff79c2f77a5e) fix(rust): Flush stdout after print to fix stream mode display ### 📊 Changes **1 file changed** (+10 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/rust/lib_ccxr/src/util/log.rs` (+10 -2) </details> ### 📄 Description ## 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 - [x] `--input scc` shows `[Stream mode: SCC]` - [x] `--input mkv` shows `[Stream mode: MKV]` - [x] `--input ts` shows `[Stream mode: Transport]` - [x] Autodetect shows `[Stream mode: Autodetect]` - [x] All 265 Rust tests pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:23:50 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2772