# undef lseek
# endif
# define lseek _lseeki64
-#elif defined( UNDER_CE )
-# define PathIsNetworkPathW(wpath) (! wcsncmp(wpath, L"\\\\", 2))
#endif
#include <vlc_fs.h>
bool b_pace_control;
};
+#ifndef WIN32
static bool IsRemote (int fd)
{
#if defined (HAVE_FSTATVFS) && defined (MNT_LOCAL)
#endif
}
+# define IsRemote(fd,path) IsRemote(fd)
+
+#else /* WIN32 */
+static bool IsRemote (const char *path)
+{
+# ifndef UNDER_CE
+ wchar_t *wpath = ToWide (path);
+ bool is_remote = (wpath != NULL && PathIsNetworkPathW (wpath));
+ free (wpath);
+ return is_remote;
+# else
+ return (! strncmp(path, "\\\\", 2));
+# endif
+}
+# define IsRemote(fd,path) IsRemote(path)
+#endif
#ifndef HAVE_POSIX_FADVISE
# define posix_fadvise(fd, off, len, adv)
int FileOpen( vlc_object_t *p_this )
{
access_t *p_access = (access_t*)p_this;
-#ifdef WIN32
- bool is_remote = false;
-#endif
/* Open file */
int fd = -1;
/* */
case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * );
- if (IsRemote (p_sys->fd))
+ if (IsRemote (p_sys->fd, p_access->psz_filepath))
*pi_64 = var_InheritInteger (p_access, "network-caching");
else
*pi_64 = var_InheritInteger (p_access, "file-caching");