[vlc-commits] file: do not turn off caching on BSD (fixes #8446)

Rémi Denis-Courmont git at videolan.org
Tue Apr 16 17:34:58 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Apr 16 18:33:43 2013 +0300| [fe0a075ef37b4b0ab6464c169afdbdd955b0d9b7] | committer: Rémi Denis-Courmont

file: do not turn off caching on BSD (fixes #8446)

Turning off the cache makes no sense here, especially right after
enabling reading ahead (which intrisically means caching).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe0a075ef37b4b0ab6464c169afdbdd955b0d9b7
---

 modules/access/file.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/modules/access/file.c b/modules/access/file.c
index 69fc0dc..b62a004 100644
--- a/modules/access/file.c
+++ b/modules/access/file.c
@@ -236,15 +236,11 @@ 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);
-#if defined(HAVE_FCNTL)
-        /* We'd rather use any available memory for reading ahead
-         * than for caching what we've already seen/heard */
-# if defined(F_RDAHEAD)
+#ifdef F_RDAHEAD
         fcntl (fd, F_RDAHEAD, 1);
-# endif
-# if defined(F_NOCACHE)
-        fcntl (fd, F_NOCACHE, 1);
-# endif
+#endif
+#ifdef F_NOCACHE
+        fcntl (fd, F_NOCACHE, 0);
 #endif
     }
     else



More information about the vlc-commits mailing list