diff mbox series

[FFmpeg-devel,1/2] fftools: use av_fopen_utf8() instead of plain fopen()

Message ID 5802c8526c48ceecf775ce49ffcac0e15b8981c3.1651945149.git.ffmpegagent@gmail.com
State New
Headers show
Series use av_fopen_utf8() instead of plain fopen() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

softworkz May 7, 2022, 5:39 p.m. UTC
From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 fftools/cmdutils.c   | 6 +++---
 fftools/ffmpeg.c     | 4 ++--
 fftools/opt_common.c | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

Comments

Martin Storsjö May 8, 2022, 8:03 p.m. UTC | #1
On Sat, 7 May 2022, softworkz wrote:

> From: softworkz <softworkz@hotmail.com>
>
> Signed-off-by: softworkz <softworkz@hotmail.com>
> ---
> fftools/cmdutils.c   | 6 +++---
> fftools/ffmpeg.c     | 4 ++--
> fftools/opt_common.c | 2 +-
> 3 files changed, 6 insertions(+), 6 deletions(-)

Just for clarity (for someone looking at this individual mail thread on 
its own); please don't do this until the issue pointed out in 
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295488.html has been 
resolved.

// Martin
Soft Works May 9, 2022, 12:21 a.m. UTC | #2
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Martin Storsjö
> Sent: Sunday, May 8, 2022 10:03 PM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH 1/2] fftools: use av_fopen_utf8()
> instead of plain fopen()
> 
> On Sat, 7 May 2022, softworkz wrote:
> 
> > From: softworkz <softworkz@hotmail.com>
> >
> > Signed-off-by: softworkz <softworkz@hotmail.com>
> > ---
> > fftools/cmdutils.c   | 6 +++---
> > fftools/ffmpeg.c     | 4 ++--
> > fftools/opt_common.c | 2 +-
> > 3 files changed, 6 insertions(+), 6 deletions(-)
> 
> Just for clarity (for someone looking at this individual mail thread
> on
> its own); please don't do this until the issue pointed out in
> https://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295488.html has
> been
> resolved.

I agree. I will retract this part of the patchset for now.

Thanks,
softworkz
diff mbox series

Patch

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 5d7cdc3e10..ca3a4c267a 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -818,7 +818,7 @@  FILE *get_preset_file(char *filename, size_t filename_size,
 
     if (is_path) {
         av_strlcpy(filename, preset_name, filename_size);
-        f = fopen(filename, "r");
+        f = av_fopen_utf8(filename, "r");
     } else {
 #if HAVE_GETMODULEHANDLE && defined(_WIN32)
         char datadir[MAX_PATH], *ls;
@@ -842,13 +842,13 @@  FILE *get_preset_file(char *filename, size_t filename_size,
                 continue;
             snprintf(filename, filename_size, "%s%s/%s.ffpreset", base[i],
                      i != 1 ? "" : "/.ffmpeg", preset_name);
-            f = fopen(filename, "r");
+            f = av_fopen_utf8(filename, "r");
             if (!f && codec_name) {
                 snprintf(filename, filename_size,
                          "%s%s/%s-%s.ffpreset",
                          base[i], i != 1 ? "" : "/.ffmpeg", codec_name,
                          preset_name);
-                f = fopen(filename, "r");
+                f = av_fopen_utf8(filename, "r");
             }
         }
     }
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index a85ed18b08..a9bd4a790f 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1261,9 +1261,9 @@  static void do_video_stats(OutputStream *ost, int frame_size)
 
     /* this is executed just the first time do_video_stats is called */
     if (!vstats_file) {
-        vstats_file = fopen(vstats_filename, "w");
+        vstats_file = av_fopen_utf8(vstats_filename, "w");
         if (!vstats_file) {
-            perror("fopen");
+            perror("av_fopen_utf8");
             exit_program(1);
         }
     }
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index c303db4d09..dda199d412 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -1178,7 +1178,7 @@  int init_report(const char *env, FILE **file)
     if (!envlevel)
         report_file_level = FFMAX(report_file_level, prog_loglevel);
 
-    report_file = fopen(filename.str, "w");
+    report_file = av_fopen_utf8(filename.str, "w");
     if (!report_file) {
         int ret = AVERROR(errno);
         av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n",