diff options
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/avutil.h | 6 | ||||
-rw-r--r-- | libavutil/file_open.c | 9 | ||||
-rw-r--r-- | libavutil/internal.h | 8 | ||||
-rw-r--r-- | libavutil/version.h | 5 |
4 files changed, 25 insertions, 3 deletions
diff --git a/libavutil/avutil.h b/libavutil/avutil.h index 4d633156d1..64b68bdbd3 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -331,12 +331,18 @@ unsigned av_int_list_length_for_size(unsigned elsize, #define av_int_list_length(list, term) \ av_int_list_length_for_size(sizeof(*(list)), list, term) +#if FF_API_AV_FOPEN_UTF8 /** * Open a file using a UTF-8 filename. * The API of this function matches POSIX fopen(), errors are returned through * errno. + * @deprecated Avoid using it, as on Windows, the FILE* allocated by this + * function may be allocated with a different CRT than the caller + * who uses the FILE*. No replacement provided in public API. */ +attribute_deprecated FILE *av_fopen_utf8(const char *path, const char *mode); +#endif /** * Return the fractional representation of the internal time base. diff --git a/libavutil/file_open.c b/libavutil/file_open.c index cc302f2f76..fb64c2e4ee 100644 --- a/libavutil/file_open.c +++ b/libavutil/file_open.c @@ -155,7 +155,7 @@ int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *l return fd; /* success */ } -FILE *av_fopen_utf8(const char *path, const char *mode) +FILE *avpriv_fopen_utf8(const char *path, const char *mode) { int fd; int access; @@ -188,3 +188,10 @@ FILE *av_fopen_utf8(const char *path, const char *mode) return NULL; return fdopen(fd, mode); } + +#if FF_API_AV_FOPEN_UTF8 +FILE *av_fopen_utf8(const char *path, const char *mode) +{ + return avpriv_fopen_utf8(path, mode); +} +#endif diff --git a/libavutil/internal.h b/libavutil/internal.h index 79c2130be0..b44cbaaa7b 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -37,6 +37,7 @@ #include <stdint.h> #include <stddef.h> #include <assert.h> +#include <stdio.h> #include "config.h" #include "attributes.h" #include "timer.h" @@ -183,8 +184,10 @@ void avpriv_request_sample(void *avc, #pragma comment(linker, "/include:" EXTERN_PREFIX "avpriv_snprintf") #endif +#define avpriv_fopen_utf8 ff_fopen_utf8 #define avpriv_open ff_open #define avpriv_tempfile ff_tempfile + #define PTRDIFF_SPECIFIER "Id" #define SIZE_SPECIFIER "Iu" #else @@ -257,6 +260,11 @@ av_warn_unused_result int avpriv_open(const char *filename, int flags, ...); /** + * Open a file using a UTF-8 filename. + */ +FILE *avpriv_fopen_utf8(const char *path, const char *mode); + +/** * Wrapper to work around the lack of mkstemp() on mingw. * Also, tries to create file in /tmp first, if possible. * *prefix can be a character constant; *filename will be allocated internally. diff --git a/libavutil/version.h b/libavutil/version.h index 6735c20090..1b4b41d81f 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,8 +79,8 @@ */ #define LIBAVUTIL_VERSION_MAJOR 57 -#define LIBAVUTIL_VERSION_MINOR 24 -#define LIBAVUTIL_VERSION_MICRO 101 +#define LIBAVUTIL_VERSION_MINOR 25 +#define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ @@ -113,6 +113,7 @@ #define FF_API_FIFO_OLD_API (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_OLD_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_MAJOR < 58) +#define FF_API_AV_FOPEN_UTF8 (LIBAVUTIL_VERSION_MAJOR < 58) /** * @} |