PR #20435 opened by caifan URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20435 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20435.patch
>From 9a657b6a0700f22d98d5f7d755e8a103fdc9d288 Mon Sep 17 00:00:00 2001 From: caifan3 <[email protected]> Date: Thu, 4 Sep 2025 20:58:24 +0800 Subject: [PATCH 1/2] FFMPEG/libavformat: fix function file_open,file_read,file_write,file_close,file_seek conflict with nuttx Signed-off-by: caifan3 <[email protected]> --- libavformat/file.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/libavformat/file.c b/libavformat/file.c index 97f5955f93..cca5b52d6c 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -138,7 +138,7 @@ static const AVClass fd_class = { .version = LIBAVUTIL_VERSION_INT, }; -static int file_read(URLContext *h, unsigned char *buf, int size) +static int ff_file_read(URLContext *h, unsigned char *buf, int size) { FileContext *c = h->priv_data; int ret; @@ -151,7 +151,7 @@ static int file_read(URLContext *h, unsigned char *buf, int size) return (ret == -1) ? AVERROR(errno) : ret; } -static int file_write(URLContext *h, const unsigned char *buf, int size) +static int ff_file_write(URLContext *h, const unsigned char *buf, int size) { FileContext *c = h->priv_data; int ret; @@ -220,7 +220,7 @@ static int fd_dup(URLContext *h, int oldfd) } #endif -static int file_close(URLContext *h) +static int ff_file_close(URLContext *h) { FileContext *c = h->priv_data; int ret = close(c->fd); @@ -228,7 +228,7 @@ static int file_close(URLContext *h) } /* XXX: use llseek */ -static int64_t file_seek(URLContext *h, int64_t pos, int whence) +static int64_t ff_file_seek(URLContext *h, int64_t pos, int whence) { FileContext *c = h->priv_data; int64_t ret; @@ -282,7 +282,7 @@ static int file_move(URLContext *h_src, URLContext *h_dst) return 0; } -static int file_open(URLContext *h, const char *filename, int flags) +static int ff_file_open(URLContext *h, const char *filename, int flags) { FileContext *c = h->priv_data; int access; @@ -409,11 +409,11 @@ static int file_close_dir(URLContext *h) const URLProtocol ff_file_protocol = { .name = "file", - .url_open = file_open, - .url_read = file_read, - .url_write = file_write, - .url_seek = file_seek, - .url_close = file_close, + .url_open = ff_file_open, + .url_read = ff_file_read, + .url_write = ff_file_write, + .url_seek = ff_file_seek, + .url_close = ff_file_close, .url_get_file_handle = file_get_handle, .url_check = file_check, .url_delete = file_delete, @@ -463,9 +463,9 @@ static int pipe_open(URLContext *h, const char *filename, int flags) const URLProtocol ff_pipe_protocol = { .name = "pipe", .url_open = pipe_open, - .url_read = file_read, - .url_write = file_write, - .url_close = file_close, + .url_read = ff_file_read, + .url_write = ff_file_write, + .url_close = ff_file_close, .url_get_file_handle = file_get_handle, .url_check = file_check, .priv_data_size = sizeof(FileContext), @@ -508,10 +508,10 @@ static int fd_open(URLContext *h, const char *filename, int flags) const URLProtocol ff_fd_protocol = { .name = "fd", .url_open = fd_open, - .url_read = file_read, - .url_write = file_write, - .url_seek = file_seek, - .url_close = file_close, + .url_read = ff_file_read, + .url_write = ff_file_write, + .url_seek = ff_file_seek, + .url_close = ff_file_close, .url_get_file_handle = file_get_handle, .url_check = file_check, .priv_data_size = sizeof(FileContext), @@ -668,10 +668,10 @@ static const AVClass android_content_class = { const URLProtocol ff_android_content_protocol = { .name = "content", .url_open = android_content_open, - .url_read = file_read, - .url_write = file_write, - .url_seek = file_seek, - .url_close = file_close, + .url_read = ff_file_read, + .url_write = ff_file_write, + .url_seek = ff_file_seek, + .url_close = ff_file_close, .url_get_file_handle = file_get_handle, .url_check = NULL, .priv_data_size = sizeof(FileContext), -- 2.49.1 >From 690f9575f619346be11ae1f9cc3e2d07abc197e4 Mon Sep 17 00:00:00 2001 From: caifan3 <[email protected]> Date: Thu, 4 Sep 2025 21:03:52 +0800 Subject: [PATCH 2/2] FFMPEG/fftools: fix function file_open,file_read,file_write,file_close,file_seek conflict with nuttx Signed-off-by: caifan3 <[email protected]> --- fftools/cmdutils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/fftools/cmdutils.h b/fftools/cmdutils.h index ad020f893a..0348bf7762 100644 --- a/fftools/cmdutils.h +++ b/fftools/cmdutils.h @@ -534,6 +534,7 @@ void *allocate_array_elem(void *array, size_t elem_size, int *nb_elems); double get_rotation(const int32_t *displaymatrix); +#define file_read ff_file_read /* read file contents into a string */ char *file_read(const char *filename); -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
