mbox series

[FFmpeg-devel,v3,0/2] use av_fopen_utf8() instead of plain fopen()

Message ID pull.26.v3.ffstaging.FFmpeg.1652747942.ffmpegagent@gmail.com
Headers show
Series use av_fopen_utf8() instead of plain fopen() | expand

Message

Aman Karmani May 17, 2022, 12:39 a.m. UTC
Unify file access operations by replacing usages of direct calls to posix
fopen()

v2: Remove changes to fftools for now
v3: Add some additional replacements

softworkz (2):
  avfilter: use av_fopen_utf8() instead of plain fopen()
  avfilter/dvdsubdec: use av_fopen_utf8() instead of plain fopen()

 libavcodec/dvdsubdec.c            | 2 +-
 libavfilter/af_firequalizer.c     | 2 +-
 libavfilter/vf_deshake.c          | 2 +-
 libavfilter/vf_psnr.c             | 2 +-
 libavfilter/vf_signature.c        | 4 ++--
 libavfilter/vf_ssim.c             | 2 +-
 libavfilter/vf_vidstabdetect.c    | 2 +-
 libavfilter/vf_vidstabtransform.c | 2 +-
 libavfilter/vf_vmafmotion.c       | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)


base-commit: e3580f60775c897c3b13b178c57ab191ecc4a031
Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-26%2Fsoftworkz%2Fsubmit_replace_fopen-v3
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-26/softworkz/submit_replace_fopen-v3
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/26

Range-diff vs v2:

 1:  e47287be64 ! 1:  d81855ba42 avfilter: use av_fopen_utf8() instead of plain fopen()
     @@ libavfilter/vf_deshake.c: static av_cold int init(AVFilterContext *ctx)
               fwrite("Ori x, Avg x, Fin x, Ori y, Avg y, Fin y, Ori angle, Avg angle, Fin angle, Ori zoom, Avg zoom, Fin zoom\n", 1, 104, deshake->fp);
       
      
     + ## libavfilter/vf_psnr.c ##
     +@@ libavfilter/vf_psnr.c: static av_cold int init(AVFilterContext *ctx)
     +         if (!strcmp(s->stats_file_str, "-")) {
     +             s->stats_file = stdout;
     +         } else {
     +-            s->stats_file = fopen(s->stats_file_str, "w");
     ++            s->stats_file = av_fopen_utf8(s->stats_file_str, "w");
     +             if (!s->stats_file) {
     +                 int err = AVERROR(errno);
     +                 char buf[128];
     +
       ## libavfilter/vf_signature.c ##
      @@ libavfilter/vf_signature.c: static int xml_export(AVFilterContext *ctx, StreamContext *sc, const char* filen
           FILE* f;
     @@ libavfilter/vf_ssim.c: static av_cold int init(AVFilterContext *ctx)
                       int err = AVERROR(errno);
                       char buf[128];
      
     + ## libavfilter/vf_vidstabdetect.c ##
     +@@ libavfilter/vf_vidstabdetect.c: static int config_input(AVFilterLink *inlink)
     +     av_log(ctx, AV_LOG_INFO, "          show = %d\n", s->conf.show);
     +     av_log(ctx, AV_LOG_INFO, "        result = %s\n", s->result);
     + 
     +-    s->f = fopen(s->result, "w");
     ++    s->f = av_fopen_utf8(s->result, "w");
     +     if (s->f == NULL) {
     +         av_log(ctx, AV_LOG_ERROR, "cannot open transform file %s\n", s->result);
     +         return AVERROR(EINVAL);
     +
     + ## libavfilter/vf_vidstabtransform.c ##
     +@@ libavfilter/vf_vidstabtransform.c: static int config_input(AVFilterLink *inlink)
     +         av_log(ctx, AV_LOG_INFO, "    zoomspeed = %g\n", tc->conf.zoomSpeed);
     +     av_log(ctx, AV_LOG_INFO, "    interpol  = %s\n", getInterpolationTypeName(tc->conf.interpolType));
     + 
     +-    f = fopen(tc->input, "r");
     ++    f = av_fopen_utf8(tc->input, "r");
     +     if (!f) {
     +         int ret = AVERROR(errno);
     +         av_log(ctx, AV_LOG_ERROR, "cannot open input file %s\n", tc->input);
     +
       ## libavfilter/vf_vmafmotion.c ##
      @@ libavfilter/vf_vmafmotion.c: static av_cold int init(AVFilterContext *ctx)
               if (!strcmp(s->stats_file_str, "-")) {
 -:  ---------- > 2:  1be02d9e04 avfilter/dvdsubdec: use av_fopen_utf8() instead of plain fopen()