Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: caifan via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: caifan <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] fftools/cmdutils: Rename file_read to ff_file_read to avoid symbol conflict (PR #20500)
Date: Fri, 12 Sep 2025 06:29:39 -0000
Message-ID: <175765858081.25.6869214606982893135@463a07221176> (raw)

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

                 reply	other threads:[~2025-09-12  6:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=175765858081.25.6869214606982893135@463a07221176 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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