[MPlayer-users] Re: zlib and fontconfig

Nicholas Schell nschell at gmail.com
Sat Nov 4 21:41:27 CET 2006


Foolish me :)

On 11/4/06, John Brown <johnbrown105 at hotmail.com> wrote:
> Nicholas Schell wrote:
> >Well I am going for a distributable mplayer build with fontconfig so I
> >do need a relative path. Which is why previously with shared
> >fontconfig using ./mplayer made everything so simple. I can't send out
> >a build which requires fonts.conf to be located at
> >"C:/msys/1.0/mingw/etc/fonts/fonts.conf" or any other absolute path,
> >it just doesn't make sense.
>
> Consider the following directory structure:
>
> [...]
>
> As I said, when I specify a relative confdir, then confdir has to exist *in
> the directory that I am in*. If I "cd \Movies\Action" and type "mplayer
> -fontconfig -font 'Courier New' Top_Gun.avi, MPlayer crashes, because
> confdir does not exist there. It is in the fontconfig source directory.
> I would have to copy confdir from the fontconfig source directory to
> C:\Movies\Action, and when I get tired of action movies, I would have to
> copy it to c:\Movies\Sci-Fi, and so on. Or, having copied the confdir to
> <mplayer-dir>\mplayer\fonts, I could stay there, and type:
> mplayer ... c:\Movies\Action\Top_Gun.avi then
> mplayer ... c:\Movies\Action\Independence_Day.ogm
> which is a nuisance, even with command recall.
>
> What you probably want is behaviour like MPlayer's --codecsdir. If
> --codecsdir=codecs, MPlayer looks for codecs relative to MPlayer.exe.
> MPlayer can be installed in any directory, as long as it has a subdirectory
> codecs with the binary codecs in it. You can run MPlayer from anywhere,
> because it will find the codecs in  <path-to-mplayer.exe>\codecs. You could
> check the MPlayer source to see how it determines the path to the
> executable, (probably argv[0] - is there an extern argv[] that is accessible
> to functions other than main()?) then implement something similar in
> fontconfig.
>
> Did you check to see whether fontconfig recognizes any environment
> variables? I had a quick look at the docs, but I did not find anything.

Ahh yes, I always forget when you use relative paths it depends on how
you call the application, as you said in your earlier responses. You
described exactly the behavior I'm looking for though, which
fontconfig does seem to show when compiled as a shared lib. I suppose
that is because it is using a relative path in relation to the DLL
itself not mplayer.exe, so it all works out in the end. That is how I
have been building it so far at least, and seems to work without
issues. If I knew at all how to code/understand any of that I would do
it, but I don't...yet. For now it seems I'll have to continue to build
fontconfig as shared so it will be useable by anyone else. Your
response has at least fueled me with info to work on, thanks :).



More information about the MPlayer-users mailing list