Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGES.TXT
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
0.96.6 (unreleased)
-------------------
- Fix: Clear status line output on Linux/WSL to prevent text artifacts (#2017)
- Fix: Prevent infinite loop on truncated MKV files
- Fix: Various memory safety and stability fixes in demuxers (MP4, PS, MKV, DVB)
- Fix: Delete empty output files instead of leaving 0-byte files (#1282)
Expand Down
21 changes: 13 additions & 8 deletions src/lib_ccx/utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,21 @@ void mprint(const char *fmt, ...)
if (!ccx_options.messages_target)
return;
va_start(args, fmt);
if (ccx_options.messages_target == CCX_MESSAGES_STDOUT)
{
vfprintf(stdout, fmt, args);
fflush(stdout);
}
else

FILE *target = (ccx_options.messages_target == CCX_MESSAGES_STDOUT) ? stdout : stderr;

if (fmt[0] == '\r')
{
vfprintf(stderr, fmt, args);
fflush(stderr);
#ifndef _WIN32
fprintf(target, "\r\033[K"); // Clear the line first
fmt++; // Skip the '\r' so only the clean text gets printed next
#endif
}
// Windows (legacy console) does not support ANSI sequences; fallback to standard \r; and vfprintf below handles it the old-fashioned way.

vfprintf(target, fmt, args);
fflush(target);

va_end(args);
}

Expand Down
Loading