Re: [Audacity-devel] FFmpeg libraries for the Mac
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Leland <le...@au...> - 2008-12-23 00:48:17
|
Gale (Audacity Team) wrote: > So Audacity looks for the current major version, which at the moment is > libavformat-52.dylib, have I got that right? > Correct. But, OSX has a bit of a limitation in regards to dynamic libraries (this is the reason for the installer) ... you can't just put the libraries anywhere since the location of their dependencies is determined at build time. So, the installer puts the libraries in /usr/local/lib/audacity. Search for libs on OSX is a bit convoluted: (from the dlopen() manpage) SEARCHING dlopen() searches for a compatible Mach-O file in the directories specified by a set of environment variables and the process's current working directory. When set, the environment variables must contain a colon-separated list of directory paths, which can be absolute or relative to the current working directory. The environment variables are LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, and DYLD_FALLBACK_LIBRARY_PATH. The first two variables have no default value. The default value of DYLD_FALLBACK_LIBRARY_PATH is $HOME/lib;/usr/local/lib;/usr/lib. dlopen() searches the directories specified in the environment variables in the order they are listed. When path doesn't contain a slash character (i.e. it is just a leaf name), dlopen() searches the following the following until it finds a compatible Mach-O file: $LD_LIBRARY_PATH, $DYLD_LIBRARY_PATH, current working directory, $DYLD_FALLBACK_LIBRARY_PATH. When path contains a slash (i.e. a full path or a partial path) dlopen() searches the following the following until it finds a compatible Mach-O file: $DYLD_LIBRARY_PATH (with leaf name from path), current working directory (for partial paths), $DYLD_FALLBACK_LIBRARY_PATH (with leaf name from path). It's not immediately obvious from that description, but the environment variables will override ANY path that the user selects via Preferences. They will also override the compiled in /usr/local/lib/audacity path. So, it's possible that Audacity will get a version of the library that wasn't the user's choice. Not much can be done about that. I'd wager this won't be a problem for most users. However, it drove me bonkers for a bit since I have my macports libraries specified in the DYLD_LIBRARY_PATH variable and the ffmpeg libs were being pulled from there rather than the ones I was telling Audacity to use. Leland |