mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-04-24 00:30:57 +08:00
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>
This commit is contained in:
@@ -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) \
|
||||
|
||||
Reference in New Issue
Block a user