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

Fixes those programs on Windows.
This commit is contained in:
Max Kellermann 2021-03-08 17:25:57 +01:00
parent d61341c0e3
commit 4d9af9a81b
3 changed files with 7 additions and 0 deletions

View File

@ -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<std::byte, 4096> buffer;
while (true) {

View File

@ -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<Mutex> lock(is.mutex);
if (seek > 0)

View File

@ -117,6 +117,8 @@ static void
RunOutput(AudioOutput &ao, AudioFormat audio_format,
FileDescriptor in_fd)
{
in_fd.SetBinaryMode();
/* open the audio output */
ao.Enable();