diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-05-04 18:51:36 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-05-04 18:53:17 +0300 |
commit | 618f760866441a01051a0177529c7524082f4e37 (patch) | |
tree | f93381a89eb9a1a173b6a7f156ab7b719809c0fe /input | |
parent | 0fff1380b18f4f695d0481fd0cb0e19e1991140a (diff) | |
download | mpv-618f760866441a01051a0177529c7524082f4e37.tar.bz2 mpv-618f760866441a01051a0177529c7524082f4e37.tar.xz |
input: make slave command file descriptors nonblocking
Neither fd 0 slave input (-slave) nor additional opened fds (-input
file=X) were set to nonblocking mode as they should have been. Fix.
Also rename the horribly generic USE_SELECT #define used for a
specific slave input detail.
Diffstat (limited to 'input')
-rw-r--r-- | input/input.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/input/input.c b/input/input.c index 808b197603..567a801ca7 100644 --- a/input/input.c +++ b/input/input.c @@ -1838,12 +1838,12 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf) if (input_conf->in_file) { struct stat st; - int mode = O_RDONLY; + int mode = O_RDONLY | O_NONBLOCK; // Use RDWR for FIFOs to ensure they stay open over multiple accesses. // Note that on Windows stat may fail for named pipes, // but due to how the API works, using RDONLY should be ok. if (stat(input_conf->in_file, &st) == 0 && S_ISFIFO(st.st_mode)) - mode = O_RDWR; + mode = O_RDWR | O_NONBLOCK; int in_file_fd = open(input_conf->in_file, mode); if (in_file_fd >= 0) mp_input_add_cmd_fd(ictx, in_file_fd, 1, NULL, |