Commit 6ef7fa72 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

file: When loading a non-local file, raise the caching with 700ms.

parent 3c4a11c4
......@@ -856,8 +856,8 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
AC_MSG_RESULT(no)])
dnl Check for headers
AC_CHECK_HEADERS(getopt.h strings.h locale.h)
AC_CHECK_HEADERS(fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h xlocale.h)
AC_CHECK_HEADERS(getopt.h strings.h locale.h xlocale.h)
AC_CHECK_HEADERS(fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h sys/mount.h)
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h netinet/udplite.h sys/eventfd.h])
AC_CHECK_HEADERS([net/if.h], [], [],
[
......
......@@ -47,6 +47,9 @@
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#if HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#if defined( WIN32 )
# include <io.h>
......@@ -171,6 +174,15 @@ static int Open( vlc_object_t *p_this )
# warning File size not known!
#endif
#if defined(HAVE_SYS_MOUNT_H) && defined(MNT_LOCAL)
struct statfs stat;
if ((fstatfs (fd, &stat) == 0) && !(stat.f_flags & MNT_LOCAL) ) {
int i_cache = var_GetInteger (p_access, "file-caching") + 700;
var_SetInteger (p_access, "file-caching", i_cache);
msg_Warn (p_access, "Opening non-local file, use more caching: %d", i_cache);
}
#endif
p_sys->fd = fd;
return VLC_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment