diff options
author | James Ross-Gowan <rossymiles@gmail.com> | 2014-02-18 18:11:59 +1100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-02-18 12:23:56 +0100 |
commit | 8567f1a997d36fcd32faf7da0b7ae6a1f9f86bed (patch) | |
tree | 4a0f40522a51961ada42ef3ca49bd79a729de666 /stream | |
parent | 472bb04e9d02ef63ad51fd15409aac8e7340cd10 (diff) | |
download | mpv-8567f1a997d36fcd32faf7da0b7ae6a1f9f86bed.tar.bz2 mpv-8567f1a997d36fcd32faf7da0b7ae6a1f9f86bed.tar.xz |
stream_file: cache remote files on Windows
Same as 6896469 but for Windows.
Diffstat (limited to 'stream')
-rw-r--r-- | stream/stream_file.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c index 570546db19..9d22bd5539 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -39,6 +39,10 @@ #include <sys/mount.h> #endif +#ifdef __MINGW32__ +#include <windows.h> +#endif + struct priv { int fd; bool close; @@ -126,6 +130,19 @@ static bool check_stream_network(stream_t *stream) return false; } +#elif defined(__MINGW32__) +static bool check_stream_network(stream_t *stream) +{ + wchar_t volume[MAX_PATH]; + wchar_t *path = mp_from_utf8(NULL, stream->path); + bool remote = false; + + if (GetVolumePathNameW(path, volume, MAX_PATH)) + remote = GetDriveTypeW(volume) == DRIVE_REMOTE; + + talloc_free(path); + return remote; +} #else static bool check_stream_network(stream_t *stream) { |