Skip to content
Snippets Groups Projects
Commit 3c50049b authored by Thomas Wulz's avatar Thomas Wulz
Browse files

output: Fix writing to stdout on Windows

By default, Windows converts "\n" to "\r\n" on stdout. Setting the mode
to binary fixes this.
parent 42b2b24f
No related branches found
No related tags found
No related merge requests found
Pipeline #566802 passed with stages
in 13 minutes and 24 seconds
......@@ -39,6 +39,11 @@
#include "output/output.h"
#include "output/muxer.h"
#ifdef _WIN32
#include <fcntl.h>
#include <io.h>
#endif
struct MuxerContext {
MuxerPriv *data;
const Muxer *impl;
......@@ -141,6 +146,11 @@ int output_open(MuxerContext **const c_out,
}
c->one_file_per_frame = name_offset || (!name && have_num_pattern);
#ifdef _WIN32
if (impl != muxers[0] && !strcmp(filename, "-"))
_setmode(_fileno(stdout), _O_BINARY);
#endif
if (c->one_file_per_frame) {
c->fps[0] = fps[0];
c->fps[1] = fps[1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment