]> git.sesse.net Git - vlc/commitdiff
file: network file extra caching for Win32
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 23 Jul 2009 15:08:44 +0000 (18:08 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 23 Jul 2009 15:09:18 +0000 (18:09 +0300)
Fixes #2983 for good ths time hopefully...

configure.ac
modules/access/file.c

index fa506ef49c774a5e003a20e89b06b3d5728b5224..44970acc61869b7f650b46cd2bb72d180e79bb3e 100644 (file)
@@ -354,6 +354,7 @@ case "${host_os}" in
         VLC_ADD_LIBS([activex mozilla],[-lgdi32])
         VLC_ADD_LIBS([cdda vcdx cddax sdl_image],[-lwinmm])
         VLC_ADD_LIBS([access_http access_mms access_udp access_tcp access_ftp access_rtmp access_output_udp access_output_shout access_output_rtmp sap slp http stream_out_standard stream_out_rtp stream_out_raop vod_rtsp access_realrtsp rtp telnet rc netsync gnutls growl_udp flac ts audioscrobbler lua remoteosd],[-lws2_32])
+        VLC_ADD_LIBS([access_file], [-lshlwapi])
     fi
     if test "${SYS}" = "mingwce"; then
         # add ws2 for closesocket, select, recv
index 59d09872978bdd9877ccb47753bcf1f73e611bd7..8f1ca9ee9af12f16a78f2b14c3ce762bcf7c7d02 100644 (file)
@@ -59,6 +59,7 @@
 #if defined( WIN32 )
 #   include <io.h>
 #   include <ctype.h>
+#   include <shlwapi.h>
 #else
 #   include <unistd.h>
 #   include <poll.h>
@@ -171,6 +172,10 @@ static int Open( vlc_object_t *p_this )
 {
     access_t     *p_access = (access_t*)p_this;
     access_sys_t *p_sys;
+#ifdef WIN32
+    wchar_t wpath[MAX_PATH+1];
+    bool is_remote = false;
+#endif
 
     STANDARD_READ_ACCESS_INIT;
     p_sys->i_nb_reads = 0;
@@ -187,6 +192,13 @@ static int Open( vlc_object_t *p_this )
     {
         msg_Dbg (p_access, "opening file `%s'", p_access->psz_path);
         fd = open_file (p_access, p_access->psz_path);
+#ifdef WIN32
+        if (MultiByteToWideChar (CP_UTF8, 0, p_access->psz_path, -1,
+                                 wpath, MAX_PATH)
+         && PathIsNetworkPathW (wpath))
+            is_remote = true;
+# define IsRemote( fd ) ((void)fd, is_remote)
+#endif
     }
     if (fd == -1)
         goto error;