mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
win32: fix fd://
Windows definitely supports Unix-style fd inheritance. This mostly worked when launched from mpv.exe, though mpv should change the file mode to O_BINARY. When launched from mpv.com, the wrapper must pass the list of handles (stored in the undocumented lpReserved2 and cbReserved2 fields) to the mpv process.
This commit is contained in:
@@ -262,9 +262,6 @@ static int open_f(stream_t *stream)
|
||||
MP_INFO(stream, "Writing to stdout...\n");
|
||||
p->fd = 1;
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
setmode(p->fd, O_BINARY);
|
||||
#endif
|
||||
p->close = false;
|
||||
} else {
|
||||
mode_t openmode = S_IRUSR | S_IWUSR;
|
||||
@@ -298,6 +295,10 @@ static int open_f(stream_t *stream)
|
||||
p->close = true;
|
||||
}
|
||||
|
||||
#ifdef __MINGW32__
|
||||
setmode(p->fd, O_BINARY);
|
||||
#endif
|
||||
|
||||
off_t len = lseek(p->fd, 0, SEEK_END);
|
||||
lseek(p->fd, 0, SEEK_SET);
|
||||
if (len != (off_t)-1) {
|
||||
|
||||
Reference in New Issue
Block a user