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 1D9EF41A22 for ; Wed, 20 Apr 2022 11:39:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6661568A8CD; Wed, 20 Apr 2022 14:39:21 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E7DB468B04B for ; Wed, 20 Apr 2022 14:39:14 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 23KBdE6d027289-23KBdE6e027289 for ; Wed, 20 Apr 2022 14:39:14 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id 57A39A1513 for ; Wed, 20 Apr 2022 14:39:14 +0300 (EEST) Date: Wed, 20 Apr 2022 14:39:14 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: <20220415080748.18517-4-nil-admirari@mailo.com> Message-ID: <4aa7a66c-605c-bed5-4d48-27b7481d5a58@martin.st> References: <20220415080748.18517-1-nil-admirari@mailo.com> <20220415080748.18517-4-nil-admirari@mailo.com> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM Subject: Re: [FFmpeg-devel] [PATCH v9 4/6] fftools/cmdutils.c: Remove MAX_PATH limit and replace fopen with av_fopen_utf8 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, 15 Apr 2022, Nil Admirari wrote: > --- > fftools/cmdutils.c | 38 +++++++++++++++++++++++++++++--------- > 1 file changed, 29 insertions(+), 9 deletions(-) > > diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c > index 5d7cdc3e..a66dbb22 100644 > --- a/fftools/cmdutils.c > +++ b/fftools/cmdutils.c > @@ -37,6 +37,7 @@ > #include "libswresample/swresample.h" > #include "libavutil/avassert.h" > #include "libavutil/avstring.h" > +#include "libavutil/avutil.h" > #include "libavutil/channel_layout.h" > #include "libavutil/display.h" > #include "libavutil/mathematics.h" > @@ -50,6 +51,7 @@ > #include "opt_common.h" > #ifdef _WIN32 > #include > +#include "compat/w32dlfcn.h" This adds a dependency on nonpublic headers - which I think can be tolerated as it's only a build-time issue, and fftools are currently built as part of the rest of the ffmpeg build anyway. > #endif > > AVDictionary *sws_dict; > @@ -812,28 +814,43 @@ FILE *get_preset_file(char *filename, size_t filename_size, > { > FILE *f = NULL; > int i; > +#if HAVE_GETMODULEHANDLE && defined(_WIN32) > + char *datadir = NULL; > +#endif > const char *base[3] = { getenv("FFMPEG_DATADIR"), > getenv("HOME"), Hmm, I guess neither of these are commonly set on Windows - otherwise this would suddenly change to interpret generic environment variables as UTF8. > FFMPEG_DATADIR, }; > > if (is_path) { > av_strlcpy(filename, preset_name, filename_size); > - f = fopen(filename, "r"); > + f = av_fopen_utf8(filename, "r"); > } else { As mentioned elsewhere, I realized that av_fopen_utf8 is problematic, but that's an orthogonal issue, and the issue is already preexisting, and it's used for a fairly marginal feature here, so I guess that can be tolerated too (and if the root cause is fixed, this gets taken care of at the same time too). // Martin _______________________________________________ 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".