1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-23 16:36:56 +00:00

stream_file: cache remote files on Windows

Same as 6896469 but for Windows.
This commit is contained in:
James Ross-Gowan 2014-02-18 18:11:59 +11:00 committed by wm4
parent 472bb04e9d
commit 8567f1a997

View File

@ -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)
{