mirror of
https://github.com/mpv-player/mpv
synced 2024-12-22 23:02:37 +00:00
stream_file: disable read ahead for remote files on macOS
this can cause stutter on remote files because in certain cases this
causes a reconnect to the remote that leads to the file not being read
fast enough. VLC had the same problem and fixes it the same way.
b8b8c438f8
Fixes #4434
This commit is contained in:
parent
3010588d14
commit
f8128f6570
@ -340,8 +340,15 @@ static int open_f(stream_t *stream, const struct stream_open_args *args)
|
|||||||
stream->get_size = get_size;
|
stream->get_size = get_size;
|
||||||
stream->close = s_close;
|
stream->close = s_close;
|
||||||
|
|
||||||
if (check_stream_network(p->fd))
|
if (check_stream_network(p->fd)) {
|
||||||
stream->streaming = true;
|
stream->streaming = true;
|
||||||
|
#if HAVE_COCOA
|
||||||
|
if (fcntl(p->fd, F_RDAHEAD, 0) < 0) {
|
||||||
|
MP_VERBOSE(stream, "Cannot disable read ahead on file '%s': %s\n",
|
||||||
|
filename, mp_strerror(errno));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
p->orig_size = get_size(stream);
|
p->orig_size = get_size(stream);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user