diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-27 11:10:26 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-27 11:10:26 +0100 |
commit | 097de4d1d68fb5aef5fc8881b2afc65db3f0dac0 (patch) | |
tree | dc90f37eeb1d3843fddb2c0eb4c73a46c4a19046 /libavformat/os_support.h | |
parent | 9f9440bd8122cc8798139c9370db0873a24ae14b (diff) | |
parent | 9326d64ed1baadd7af60df6bbcc59cf1fefede48 (diff) |
Merge commit '9326d64ed1baadd7af60df6bbcc59cf1fefede48'
* commit '9326d64ed1baadd7af60df6bbcc59cf1fefede48':
Share the utf8 to wchar conversion routine between lavf and lavu
Conflicts:
libavformat/os_support.h
libavutil/file_open.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/os_support.h')
-rw-r--r-- | libavformat/os_support.h | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/libavformat/os_support.h b/libavformat/os_support.h index 17e362b8b2..73b7f9f65b 100644 --- a/libavformat/os_support.h +++ b/libavformat/os_support.h @@ -144,24 +144,7 @@ int ff_poll(struct pollfd *fds, nfds_t numfds, int timeout); #elif defined(_WIN32) #include <stdio.h> #include <windows.h> -#include "libavutil/mem.h" - -static inline int utf8towchar(const char *filename_utf8, wchar_t **filename_w) -{ - int num_chars; - num_chars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename_utf8, -1, NULL, 0); - if (num_chars <= 0) { - *filename_w = NULL; - return 0; - } - *filename_w = (wchar_t *)av_mallocz(sizeof(wchar_t) * num_chars); - if (!*filename_w) { - errno = ENOMEM; - return -1; - } - MultiByteToWideChar(CP_UTF8, 0, filename_utf8, -1, *filename_w, num_chars); - return 0; -} +#include "libavutil/wchar_filename.h" #define DEF_FS_FUNCTION(name, wfunc, afunc) \ static inline int win32_##name(const char *filename_utf8) \ |