* [FFmpeg-devel] [PATCH] fftools/cmdutils: Rename file_read to ff_file_read to avoid symbol conflict (PR #20500)
@ 2025-09-12 6:29 caifan via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: caifan via ffmpeg-devel @ 2025-09-12 6:29 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: caifan
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 <caifan3@xiaomi.com>
>From 26131ffb5546cfbbe528f4286bc347b35b218e7a Mon Sep 17 00:00:00 2001
From: caifan3 <caifan3@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 <caifan3@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-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-09-12 6:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-12 6:29 [FFmpeg-devel] [PATCH] fftools/cmdutils: Rename file_read to ff_file_read to avoid symbol conflict (PR #20500) caifan via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git