[FFmpeg-devel] [PATCH] set FONTCONFIG_PATH relative to ffmpeg binary, if it is a static build

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Feb 17 15:31:39 CET 2014


On 17.02.2014, at 14:27, Helmut Tessarek <tessarek at evermeet.cx> wrote:
> On 17.02.14 8:15 , Nicolas George wrote:
>> There is something fishy about this: getcwd() will return you the path where
>> ffmpeg was started from too. There is no reliable portable way of finding
>> the path of the binary that started a program.

It depends in which context you define reliable.
If you only think of the shell or system() calls and don't consider people being careless with exec arguments then combining cwd and path from argv[0] should work.
If there are better OS-specific methods, having such a function that does the best possible in libavutil might be nice...

> I have to look into it again, but there was definitely a reason why I did it
> this way. I wrote it a while back as a quick hack and I remember that it did
> not work, when I just set it to 'fonts' or './fonts'.

There are good security arguments to not accept relative paths, so fontconfig might ignore them on purpose.


> 
> Cheers,
>  Helmut
> 
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list