forked from steve-m/librtlsdr
-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Description
Issue: src/rtl_sdr.c doesn't set stdout to BINARY mode on windows.
This causes the output stream to be translated by Windows which causes:
- Specific byte values/sequences are interpreted and malformed
- The I/Q byte packing can fall out of sync due to removal/addition of bytes
- Streams closes abruptly because a EOF text character was sent
Fix: Line 291 in src/rtl_sdr.c
-- _setmode(_fileno(stdin), _O_BINARY)
++ _setmode(_fileno(stdout), _O_BINARY)
Changing stdin to stdout will actually set stdout to BINARY mode.
Relevant documentation:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/translation-mode-constants?view=msvc-170
Metadata
Metadata
Assignees
Labels
No labels