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], [], [],
[
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
+#if HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
#if defined( WIN32 )
# include <io.h>
# 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;