From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 53A2C4314E for ; Mon, 23 May 2022 11:26:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C5A3768B4B5; Mon, 23 May 2022 14:26:22 +0300 (EEST) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E4F368B1F7 for ; Mon, 23 May 2022 14:26:14 +0300 (EEST) Received: by mail-pj1-f41.google.com with SMTP id gg20so13755116pjb.1 for ; Mon, 23 May 2022 04:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:in-reply-to:references:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=eaY25NvqJeWv0FycCUyqDIyLR7iOFNRB4xYvSeJ+/kw=; b=hDYkkIYnBFPLSrVDTzSGURkPeLFxgfz4rHO7ch0Ybwq/TyEIE3yfDpgkPfTlGPcjXi gvnAi2BVLYiBn62onIyZ4i7X27M1wVhKQ/r1D/JE8IMlGkis06Mb/9OjqY3Lpo8S/NZM IqQp1pzjpcPpLzePTPPJbwJvTlPIJR9waBvUSmbVfFuc1hrFuLXDVgK3yTsIC9YqdJ8s poGOzhq9w2I7A3HYruw/DSW18C5SVnB+xqVVIidXxJJdPMvgmF2CiTau02ebJY7rPvaC VxBXCfLhaQDqBelDC3N7Z6O0JR8N1s6rhUcsiM8naoCen/KqcV0EHnnKf9geAJrA9hnI Yfrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:in-reply-to:references:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=eaY25NvqJeWv0FycCUyqDIyLR7iOFNRB4xYvSeJ+/kw=; b=SwDYw39ma/3NMwelitiFFG9DRpkbVsPeVJdMIhEDM+wptfMRIrgsdIQKraoB4W4srz mO0TZ3HwRHtJunBlozSB7OWo7sBlGJECrR3WfPmlyjylwIKvPLz99U8rHlVy9EUkcZuh gNTV1wSkfCIADxPsv3fgXyBaqtXCoAZILI2DhPYIH6kB8y1U0vW0gPqqvSt/WcZOfVUU jGxPr0ab14uLwSupvDJM6EmF1FV9V9hssuc/qXmUtHg4b4Yt4I6FOpnMXPqRu/qflVVO IuzsLs0TkTVyZp/NIEpIBiINNhFgPzr4pTAOIi89XsKNLxPhkBaoXtIW9uiNOqkKUjt3 CbLg== X-Gm-Message-State: AOAM531PRnaHY/QY5S7jtTk70ZZKrnCmVcU7R27i+oU445XI9NGsuA1u iTrQyRKXmsdCx7zSKWrJwrzin9Rr1dp2Bg== X-Google-Smtp-Source: ABdhPJwSViiKafWI5R2q+K8g9RqpIra9sqPKz9PDn12Ej3I8MfWWKLzbG+Jakd2ydA8/JpX3QcJedQ== X-Received: by 2002:a17:902:e94e:b0:15b:22a7:f593 with SMTP id b14-20020a170902e94e00b0015b22a7f593mr22429659pll.148.1653305172837; Mon, 23 May 2022 04:26:12 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id w2-20020a628202000000b0050dc7628175sm6996473pfd.79.2022.05.23.04.26.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 May 2022 04:26:12 -0700 (PDT) From: softworkz X-Google-Original-From: softworkz Message-Id: In-Reply-To: References: Date: Mon, 23 May 2022 11:26:09 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v7 1/2] avfilter: use av_fopen_utf8() instead of plain fopen() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Martin =?UTF-8?Q?Storsj=C3=B6?= , softworkz , Tobias Rapp Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: softworkz Unify file access operations by replacing usages of direct calls to posix fopen() to prepare for long filename support on Windows. Signed-off-by: softworkz --- 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 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libavfilter/af_firequalizer.c b/libavfilter/af_firequalizer.c index c19a2fe122..85bdb59209 100644 --- a/libavfilter/af_firequalizer.c +++ b/libavfilter/af_firequalizer.c @@ -604,7 +604,7 @@ static int generate_kernel(AVFilterContext *ctx, const char *gain, const char *g if (ret < 0) return ret; - if (s->dumpfile && (!s->dump_buf || !s->analysis_rdft || !(dump_fp = fopen(s->dumpfile, "w")))) + if (s->dumpfile && (!s->dump_buf || !s->analysis_rdft || !(dump_fp = avpriv_fopen_utf8(s->dumpfile, "w")))) av_log(ctx, AV_LOG_WARNING, "dumping failed.\n"); vars[VAR_CHS] = inlink->ch_layout.nb_channels; diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c index 4f28467bb2..b37cffba9d 100644 --- a/libavfilter/vf_deshake.c +++ b/libavfilter/vf_deshake.c @@ -353,7 +353,7 @@ static av_cold int init(AVFilterContext *ctx) } if (deshake->filename) - deshake->fp = fopen(deshake->filename, "w"); + deshake->fp = avpriv_fopen_utf8(deshake->filename, "w"); if (deshake->fp) 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); diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c index 19852eaa69..fdfd211401 100644 --- a/libavfilter/vf_psnr.c +++ b/libavfilter/vf_psnr.c @@ -280,7 +280,7 @@ 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 = avpriv_fopen_utf8(s->stats_file_str, "w"); if (!s->stats_file) { int err = AVERROR(errno); char buf[128]; diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c index 4ca57ebf1d..5cff149756 100644 --- a/libavfilter/vf_signature.c +++ b/libavfilter/vf_signature.c @@ -386,7 +386,7 @@ static int xml_export(AVFilterContext *ctx, StreamContext *sc, const char* filen FILE* f; unsigned int pot3[5] = { 3*3*3*3, 3*3*3, 3*3, 3, 1 }; - f = fopen(filename, "w"); + f = avpriv_fopen_utf8(filename, "w"); if (!f) { int err = AVERROR(EINVAL); char buf[128]; @@ -500,7 +500,7 @@ static int binary_export(AVFilterContext *ctx, StreamContext *sc, const char* fi if (!buffer) return AVERROR(ENOMEM); - f = fopen(filename, "wb"); + f = avpriv_fopen_utf8(filename, "wb"); if (!f) { int err = AVERROR(EINVAL); char buf[128]; diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c index 32f313817d..bceb3288ef 100644 --- a/libavfilter/vf_ssim.c +++ b/libavfilter/vf_ssim.c @@ -404,7 +404,7 @@ 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 = avpriv_fopen_utf8(s->stats_file_str, "w"); if (!s->stats_file) { int err = AVERROR(errno); char buf[128]; diff --git a/libavfilter/vf_vidstabdetect.c b/libavfilter/vf_vidstabdetect.c index 267a62ea9b..044911ec27 100644 --- a/libavfilter/vf_vidstabdetect.c +++ b/libavfilter/vf_vidstabdetect.c @@ -126,7 +126,7 @@ 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 = avpriv_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); diff --git a/libavfilter/vf_vidstabtransform.c b/libavfilter/vf_vidstabtransform.c index 4619e9b256..de303554cd 100644 --- a/libavfilter/vf_vidstabtransform.c +++ b/libavfilter/vf_vidstabtransform.c @@ -191,7 +191,7 @@ 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 = avpriv_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); diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c index 8b7e9b17ef..6ae968f7e9 100644 --- a/libavfilter/vf_vmafmotion.c +++ b/libavfilter/vf_vmafmotion.c @@ -312,7 +312,7 @@ 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 = avpriv_fopen_utf8(s->stats_file_str, "w"); if (!s->stats_file) { int err = AVERROR(errno); char buf[128]; -- ffmpeg-codebot _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".