[MPlayer-dev-eng] [PATCH] Windows DLL support for OS X/Intel
vuori at sci.fi
Sun Jul 23 18:51:12 CEST 2006
I have patched the svn-trunk version of mplayer to support Windows DLL
codecs on MacOS X (Intel). The patch and a binary (with Gianluigi
Tiesi's memalign patch and without MMX support) is available at
http://www.notcom.org/mplayer/ ). You'll need the mplayer codec pack
installed it in /usr/local/lib/codecs to use it. I've only tested the
WMV3 codec (in avi and wmv containers). QTX emulation is not
supported, though it probably wouldn't be hard to add.
IMPORTANT: You _must_ define the environment variable DYLD_BIND_AT_LAUNCH
for the DLL codecs to work (ie. "DYLD_BIND_AT_LAUNCH=1 ./mplayer foo.wmv").
Otherwise mplayer crashes when dyld tries to bind functions while running
inside win32 compatibility functions.
It would be nice if the -bind_at_load flag to ld worked, but alas, it
doesn't (the flag MH_BINDATLOAD is set in the Mach-O header but dyld
apparently ignores it). If anyone has a better workaround, feel free
- The anonymous mmap() stuff with #ifdef __APPLE__ is silly. A generic
mmap-wrapper would probably be nice. Is there a reason why FILE_dommap
isn't used everywhere in ext.c?
- stubs.s has been changed to play nice with the Great Leader's lame
assembler. It should work with newer versions of gas, but someone
should probably check whether Sun's as supports .p2align. The file
should also be renamed stubs.S now, I guess. loader_objfix.sh shouldn't
be necessary anymore.
- #pragma pack() doesn't seem to work with the Great Leader's gcc for
whatever reason. The current hack in poppack.h seems to work, but
isn't particularly pretty.
I'll clean up the mmap() issue if someone has suggestions for the best
way of dealing with it. I'll see about opening a bug about the MH_BINDATLOAD
issue with Apple, but I don't have high hopes of seeing that fixed soon.
As an aside, is someone working on putting together a commit-worthy
solution to the assembler issue with the MMX code? I looked at it
earlier, the macro support in the Apple as seemed pretty braindamaged
and non-forward-compatible too so some sort of hackery is probably
More information about the MPlayer-dev-eng