mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
pacat: Enable binary mode on Windows.
Without this reading from stdin will eventually end with EOF (if there happens to be a newline sign in the stream), because read() returns 0. This patch fixes raw data input and piping to pacat on Windows.
This commit is contained in:
parent
0b72a87c26
commit
c1637652ea
1 changed files with 4 additions and 0 deletions
|
|
@ -1129,6 +1129,10 @@ int main(int argc, char *argv[]) {
|
|||
pa_disable_sigpipe();
|
||||
|
||||
if (raw) {
|
||||
#ifdef OS_IS_WIN32
|
||||
/* need to turn on binary mode for stdio io. Windows, meh */
|
||||
setmode(mode == PLAYBACK ? STDIN_FILENO : STDOUT_FILENO, O_BINARY);
|
||||
#endif
|
||||
if (!(stdio_event = mainloop_api->io_new(mainloop_api,
|
||||
mode == PLAYBACK ? STDIN_FILENO : STDOUT_FILENO,
|
||||
mode == PLAYBACK ? PA_IO_EVENT_INPUT : PA_IO_EVENT_OUTPUT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue