[FFmpeg-cvslog] fftools: Fix preset search pathes

Nicolas Gaullier git at videolan.org
Fri Jul 8 15:01:45 EEST 2022


ffmpeg | branch: master | Nicolas Gaullier <nicolas.gaullier at cji.paris> | Thu Jun 30 12:40:35 2022 +0200| [d3cf7be5a4bd0c6bb80032c7697a8819563112c8] | committer: Timo Rothenpieler

fftools: Fix preset search pathes

regression since 13350e81fd

Fix looking for .ffmpeg subfolder in FFMPEG_DATADIR and inversely not in HOME.
Fix search order (documentation).

Signed-off-by: Timo Rothenpieler <timo at rothenpieler.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d3cf7be5a4bd0c6bb80032c7697a8819563112c8
---

 fftools/cmdutils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 69a6f54ea3..18e768b386 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -822,8 +822,8 @@ FILE *get_preset_file(char *filename, size_t filename_size,
 #endif
     char *env_home = getenv_utf8("HOME");
     char *env_ffmpeg_datadir = getenv_utf8("FFMPEG_DATADIR");
-    const char *base[3] = { env_home,
-                            env_ffmpeg_datadir,
+    const char *base[3] = { env_ffmpeg_datadir,
+                            env_home,   /* index=1(HOME) is special: search in a .ffmpeg subfolder */
                             FFMPEG_DATADIR, };
 
     if (is_path) {



More information about the ffmpeg-cvslog mailing list