Commit 4d9af9a8 authored by Max Kellermann's avatar Max Kellermann

test/run_{input,output,convert}: switch file descriptors to binary mode

Fixes those programs on Windows.
parent d61341c0
...@@ -106,6 +106,9 @@ static void ...@@ -106,6 +106,9 @@ static void
RunConvert(PcmConvert &convert, size_t in_frame_size, RunConvert(PcmConvert &convert, size_t in_frame_size,
FileDescriptor in_fd, FileDescriptor out_fd) FileDescriptor in_fd, FileDescriptor out_fd)
{ {
in_fd.SetBinaryMode();
out_fd.SetBinaryMode();
StaticFifoBuffer<std::byte, 4096> buffer; StaticFifoBuffer<std::byte, 4096> buffer;
while (true) { while (true) {
......
...@@ -164,6 +164,8 @@ static int ...@@ -164,6 +164,8 @@ static int
dump_input_stream(InputStream &is, FileDescriptor out, dump_input_stream(InputStream &is, FileDescriptor out,
offset_type seek, size_t chunk_size) offset_type seek, size_t chunk_size)
{ {
out.SetBinaryMode();
std::unique_lock<Mutex> lock(is.mutex); std::unique_lock<Mutex> lock(is.mutex);
if (seek > 0) if (seek > 0)
......
...@@ -117,6 +117,8 @@ static void ...@@ -117,6 +117,8 @@ static void
RunOutput(AudioOutput &ao, AudioFormat audio_format, RunOutput(AudioOutput &ao, AudioFormat audio_format,
FileDescriptor in_fd) FileDescriptor in_fd)
{ {
in_fd.SetBinaryMode();
/* open the audio output */ /* open the audio output */
ao.Enable(); ao.Enable();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment