From: Nil Admirari <nil-admirari@mailo.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH v15 5/5] libavfilter/vf_frei0r.c: Use UTF-8 version of getenv()
Date: Wed, 15 Jun 2022 22:51:28 +0300
Message-ID: <20220615195128.15796-5-nil-admirari@mailo.com> (raw)
In-Reply-To: <20220615195128.15796-1-nil-admirari@mailo.com>
---
libavfilter/vf_frei0r.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c
index f11ae6e55c..727e96561a 100644
--- a/libavfilter/vf_frei0r.c
+++ b/libavfilter/vf_frei0r.c
@@ -31,6 +31,7 @@
#include "libavutil/avstring.h"
#include "libavutil/common.h"
#include "libavutil/eval.h"
+#include "libavutil/getenv_utf8.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
@@ -204,7 +205,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
}
/* see: http://frei0r.dyne.org/codedoc/html/group__pluglocations.html */
- if ((path = av_strdup(getenv("FREI0R_PATH")))) {
+ if ((path = getenv_utf8("FREI0R_PATH"))) {
#ifdef _WIN32
const char *separator = ";";
#else
@@ -231,12 +232,17 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
if (ret < 0)
return ret;
}
- if (!s->dl_handle && (path = getenv("HOME"))) {
+ if (!s->dl_handle && (path = getenv_utf8("HOME"))) {
char *prefix = av_asprintf("%s/.frei0r-1/lib/", path);
- if (!prefix)
- return AVERROR(ENOMEM);
+ if (!prefix) {
+ ret = AVERROR(ENOMEM);
+ goto home_path_end;
+ }
ret = load_path(ctx, &s->dl_handle, prefix, dl_name);
av_free(prefix);
+
+ home_path_end:
+ av_free(path);
if (ret < 0)
return ret;
}
--
2.34.1
_______________________________________________
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".
prev parent reply other threads:[~2022-06-15 19:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 19:51 [FFmpeg-devel] [PATCH v15 1/5] libavutil: Add wchartoutf8(), wchartoansi(), utf8toansi() and getenv_utf8() Nil Admirari
2022-06-15 19:51 ` [FFmpeg-devel] [PATCH v15 2/5] compat/w32dlfcn.h: Remove MAX_PATH limit and replace LoadLibraryExA with LoadLibraryExW Nil Admirari
2022-06-15 19:51 ` [FFmpeg-devel] [PATCH v15 3/5] fftools: Remove MAX_PATH limit and switch to UTF-8 versions of fopen() and getenv() Nil Admirari
2022-06-15 19:51 ` [FFmpeg-devel] [PATCH v15 4/5] libavformat: Remove MAX_PATH limit and use UTF-8 version of getenv() Nil Admirari
2022-06-15 19:51 ` Nil Admirari [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220615195128.15796-5-nil-admirari@mailo.com \
--to=nil-admirari@mailo.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git