[MPlayer-cygwin] Some mingw oddities.
Erik Augustson
erik_27can at yahoo.com
Tue Dec 7 04:26:43 CET 2004
Greetings,
With a bit of hacking, I was recently able to add toolame and x264 support
under mingw. I'm sure there are some better fixes, but here are the problems
I encountered nonetheless:
The x264 codec from videolan.org is too old, and rather than trying to compile
subversion in mingw (too time consuming), I CVS'd ffdshow which has a mingw
usable x264 codec in ffdshow/src/codecs/x264. This will make an appropriate
ff_x264.dll, and has all the necessary headers of course to compile mplayer
against x264. I then proceeded to install toolame-02.m-beta8, both of which
compiled *out-of-the-box*, copied the appropriate headers to /mingw/include,
libraries to /mingw/lib and binaries to /mingw/bin (neither of which had a
make install rule).
Configure went smoothly and detected both, so I then began compiling.
First error i encountered was:
In file included from ve_x264.c:50:
C:/mingw/include/x264.h:117: parse error before "va_list"
ve_x264.c:52:5: string constants are not valid in #if
make[1]: *** [ve_x264.o] Error 1
make[1]: Leaving directory `/mingw/MPlayer-20041206/libmpcodecs'
make: *** [libmpcodecs/libmpcodecs.a] Error 2
After a bit of googling and digging, I found that changing the line at 117 in
x264.h...
-void (*pf_log)( void *, int i_level, const char *psz, va_list );
+void (*pf_log)( void *, int i_level, const char *psz, __gnuc_va_list );
was the fix (see /mingw/lib/gcc-lib/mingw32/3.2.3/include/stdarg.h) for x264,
and I had to comment out:
#if X264_BUILD < 0x000c
#error We do not support old versions of x264. Get the latest from SVN.
#endif
in libmpcodecs/ve_x264.c @ line 52
This fixed x264, the next error I encountered was at the final linking stage,
there was a multiple definition of `freq2bark' in both libmp3lame.a(util.o) and
libtoolame.a(ath.o), which resulted in a make: Error 1. I fixed this by
removing the duplicated freq2bark from toolame at the bottom of libtoolame/ath.c
(which was borrowed from lame anyways) and reinstalling libtoolame. This fixed
the final linking, and mplayer and mencoder both compiled fine. The only problem
with this was, after removing freq2bark and reinstalling libtoolame.a, configure
won't find toolame after this fix. I'm sure you could #define HAVE_TOOLAME 1 in
config.h and add -ltoolame in config.mak even if configure doesn't pick it up,
but i'm curious if there's a way to modify how configure checks for it under
mingw.
Regards,
Erik
P.S. If anyone is interested in testing them, I zipped them up and you can get
them at http://vayne.fdns.net. It's vanilla mplayer source + reimar's vo_gl
reworked patch. I haven't tested encoding yet with either x264 or toolame, so
i'm curious how they're working.
More information about the MPlayer-cygwin
mailing list