Skip to content

Commit

Permalink
access/file: don't read-ahead when processing remote contents (closes…
Browse files Browse the repository at this point in the history
… #9885, refs #8446)

OS X Mavericks takes read-ahead very seriously when accessing SMB drives, so it caches up to a 100 MB. However, when the end of said cache is reached, VLC will stutter because the file system needs to re-connect to the server first. Disabling read-ahead leads to a continous data flow at the media's bitrate.

This solves a regression introduced in fe0a075
  • Loading branch information
fkuehne committed Apr 27, 2014
1 parent dc44a90 commit b8b8c43
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/access/file.c
Expand Up @@ -235,11 +235,14 @@ int FileOpen( vlc_object_t *p_this )
posix_fadvise (fd, 0, 4096, POSIX_FADV_WILLNEED);
/* In most cases, we only read the file once. */
posix_fadvise (fd, 0, 0, POSIX_FADV_NOREUSE);
#ifdef F_RDAHEAD
fcntl (fd, F_RDAHEAD, 1);
#endif
#ifdef F_NOCACHE
fcntl (fd, F_NOCACHE, 0);
#endif
#ifdef F_RDAHEAD
if (IsRemote(fd, p_access->psz_filepath))
fcntl (fd, F_RDAHEAD, 0);
else
fcntl (fd, F_RDAHEAD, 1);
#endif
}
else
Expand Down

0 comments on commit b8b8c43

Please sign in to comment.