From 4d9af9a81bb317585a1dce0620c1bb3468e5a0a6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 8 Mar 2021 17:25:57 +0100 Subject: [PATCH] test/run_{input,output,convert}: switch file descriptors to binary mode Fixes those programs on Windows. --- test/run_convert.cxx | 3 +++ test/run_input.cxx | 2 ++ test/run_output.cxx | 2 ++ 3 files changed, 7 insertions(+) diff --git a/test/run_convert.cxx b/test/run_convert.cxx index 24d64c462..b7a687c03 100644 --- a/test/run_convert.cxx +++ b/test/run_convert.cxx @@ -106,6 +106,9 @@ static void RunConvert(PcmConvert &convert, size_t in_frame_size, FileDescriptor in_fd, FileDescriptor out_fd) { + in_fd.SetBinaryMode(); + out_fd.SetBinaryMode(); + StaticFifoBuffer buffer; while (true) { diff --git a/test/run_input.cxx b/test/run_input.cxx index 0607dd3c6..6c2f360a3 100644 --- a/test/run_input.cxx +++ b/test/run_input.cxx @@ -164,6 +164,8 @@ static int dump_input_stream(InputStream &is, FileDescriptor out, offset_type seek, size_t chunk_size) { + out.SetBinaryMode(); + std::unique_lock lock(is.mutex); if (seek > 0) diff --git a/test/run_output.cxx b/test/run_output.cxx index 4fd3ff2ea..6d917600d 100644 --- a/test/run_output.cxx +++ b/test/run_output.cxx @@ -117,6 +117,8 @@ static void RunOutput(AudioOutput &ao, AudioFormat audio_format, FileDescriptor in_fd) { + in_fd.SetBinaryMode(); + /* open the audio output */ ao.Enable();