PR #20500 opened by caifan URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20500 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20500.patch
The function name 'file_read' is too generic and may conflict with other functions in external code or libraries. Prefixing it with 'ff_' aligns with FFmpeg's naming convention and improves namespace isolation. Signed-off-by: caifan3 <caif...@xiaomi.com> >From 26131ffb5546cfbbe528f4286bc347b35b218e7a Mon Sep 17 00:00:00 2001 From: caifan3 <caif...@xiaomi.com> Date: Fri, 12 Sep 2025 14:23:53 +0800 Subject: [PATCH] fftools/cmdutils: Rename file_read to ff_file_read to avoid symbol conflict The function name 'file_read' is too generic and may conflict with other functions in external code or libraries. Prefixing it with 'ff_' aligns with FFmpeg's naming convention and improves namespace isolation. Signed-off-by: caifan3 <caif...@xiaomi.com> --- fftools/cmdutils.c | 4 ++-- fftools/cmdutils.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index dc093b0bd3..818bb40438 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -263,7 +263,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt, return AVERROR(EINVAL); } - arg_allocated = file_read(arg); + arg_allocated = ff_file_read(arg); if (!arg_allocated) { av_log(NULL, AV_LOG_FATAL, "Error reading the value for option '%s' from file: %s\n", @@ -1498,7 +1498,7 @@ double get_rotation(const int32_t *displaymatrix) } /* read file contents into a string */ -char *file_read(const char *filename) +char *ff_file_read(const char *filename) { AVIOContext *pb = NULL; int ret = avio_open(&pb, filename, AVIO_FLAG_READ); diff --git a/fftools/cmdutils.h b/fftools/cmdutils.h index ad020f893a..e780999c77 100644 --- a/fftools/cmdutils.h +++ b/fftools/cmdutils.h @@ -535,7 +535,7 @@ void *allocate_array_elem(void *array, size_t elem_size, int *nb_elems); double get_rotation(const int32_t *displaymatrix); /* read file contents into a string */ -char *file_read(const char *filename); +char *ff_file_read(const char *filename); /* Remove keys in dictionary b from dictionary a */ void remove_avoptions(AVDictionary **a, AVDictionary *b); -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-le...@ffmpeg.org