[vlc-devel] [PATCH] access/file: don't read-ahead when processing remote contents (closes #9885, refs #8446)

Felix Paul Kühne fkuehne at videolan.org
Sun Apr 27 12:34:41 CEST 2014


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 fe0a075ef3
---
 modules/access/file.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/access/file.c b/modules/access/file.c
index 6d4423e..a21dc65 100644
--- a/modules/access/file.c
+++ b/modules/access/file.c
@@ -235,12 +235,15 @@ 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
+#ifdef F_NO
         fcntl (fd, F_NOCACHE, 0);
 #endif
+#ifdef F_RDAHEAD
+        if (IsRemote)
+            fcntl (fd, F_RDAHEAD, 0);
+        else
+            fcntl (fd, F_RDAHEAD, 1);
+#endif
     }
     else
     {
-- 
1.8.5.2 (Apple Git-48)




More information about the vlc-devel mailing list