From 13350e81fd43cbd1aa3bbb7ed567e7dc7dd2b7f5 Mon Sep 17 00:00:00 2001 From: Nil Admirari Date: Mon, 20 Jun 2022 13:29:59 +0300 Subject: fftools: Remove MAX_PATH limit and switch to UTF-8 versions of fopen() and getenv() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- fftools/ffmpeg_opt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'fftools/ffmpeg_opt.c') diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 398067da96..e08455478f 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -44,6 +44,7 @@ #include "libavutil/avutil.h" #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" +#include "libavutil/getenv_utf8.h" #include "libavutil/intreadwrite.h" #include "libavutil/fifo.h" #include "libavutil/mathematics.h" @@ -1402,8 +1403,10 @@ static int get_preset_file_2(const char *preset_name, const char *codec_name, AV { int i, ret = -1; char filename[1000]; - const char *base[3] = { getenv("AVCONV_DATADIR"), - getenv("HOME"), + char *env_avconv_datadir = getenv_utf8("AVCONV_DATADIR"); + char *env_home = getenv_utf8("HOME"); + const char *base[3] = { env_avconv_datadir, + env_home, AVCONV_DATADIR, }; @@ -1421,6 +1424,8 @@ static int get_preset_file_2(const char *preset_name, const char *codec_name, AV ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL); } } + freeenv_utf8(env_home); + freeenv_utf8(env_avconv_datadir); return ret; } -- cgit v1.2.3