diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index 73220cbd739..1bf4efca8a0 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -55,6 +55,7 @@ int BLI_rename(const char *from, const char *to); int BLI_delete(const char *path, int dir, int recursive); int BLI_move(const char *path, const char *to); int BLI_create_symlink(const char *path, const char *to); +int BLI_stat(const char *path, struct stat *buffer); /* Directories */ diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 0245a9c90af..047463f1e26 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -493,6 +493,23 @@ int BLI_exists(const char *name) return(st.st_mode); } + +#ifdef WIN32 +int BLI_stat(const char *path, struct stat *buffer) +{ + int r; + UTF16_ENCODE(path); + r=_wstat(path_16,buffer); + UTF16_UN_ENCODE(path); + return r; +} +#else +int BLI_stat(const char *path, struct stat *buffer) +{ + return stat(path, buffer); +} +#endif + /* would be better in fileops.c except that it needs stat.h so add here */ int BLI_is_dir(const char *file) { diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 62cf206dfec..99872192e32 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -40,6 +40,7 @@ #endif #include "BLI_blenlib.h" +#include "BLI_fileops.h" #include "DNA_userdef_types.h" #include "BKE_global.h" @@ -342,14 +343,14 @@ int imb_get_anim_type(const char * name) /* stat test below fails on large files > 4GB */ if (isffmpeg(name)) return (ANIM_FFMPEG); # endif - if (stat(name, &st) == -1) return(0); + if (BLI_stat(name, &st) == -1) return(0); if (((st.st_mode) & S_IFMT) != S_IFREG) return(0); if (isavi(name)) return (ANIM_AVI); if (ismovie(name)) return (ANIM_MOVIE); #else - if (stat(name, &st) == -1) return(0); + if (BLI_stat(name, &st) == -1) return(0); if (((st.st_mode) & S_IFMT) != S_IFREG) return(0); if (ismovie(name)) return (ANIM_MOVIE); @@ -359,6 +360,8 @@ int imb_get_anim_type(const char * name) # ifdef WITH_FFMPEG if (isffmpeg(name)) return (ANIM_FFMPEG); # endif + + if (isavi(name)) return (ANIM_AVI); #endif #ifdef WITH_REDCODE