[FFmpeg-devel] [PATCH] FATE tests don't build when SDL is installed (Win7 with MinGW32).

gregory.wolfe at kodakalaris.com gregory.wolfe at kodakalaris.com
Fri Mar 7 23:38:09 CET 2014


> On Tue, Mar 04, 2014 at 02:21:22PM -0500, gregory.wolfe at kodakalaris.com 
wrote:
> > A while back I submitted a bug tracker ticket for this (#3368).  Since 
I
> > have already done the work, I figured I might as well share it.
> > 
> > 
> > Patched files:  46 source files (see .patch file attached)
> > Description (from commit message):
> > 
> > Documented in ticket #3368, same problem as described in ticket #256.
> > When SDL is being used, compile flags include -Dmain=SDL_main, which
> > causes problems for FATE test programs.  Applied same fix as in #256:
> > if building using MinGW32, simply #undef main prior to 
main(argc,argv).
> [...]
> > diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
> > index 6308348..a34bee2 100644
> > --- a/libavcodec/dct-test.c
> > +++ b/libavcodec/dct-test.c
> > @@ -541,6 +541,10 @@ static void help(void)
> >  #include "compat/getopt.c"
> >  #endif
> > 
> > +#ifdef __MINGW32__
> > +#undef main /* We don't want SDL to override our main() */
> > +#endif
> > +
> >  int main(int argc, char **argv)
> >  {
> >      int test_idct = 0, test_248_dct = 0;
> 
> adding this same "hack" to every file is kind of ugly
> cant the "-Dmain=SDL_main" thing be filtered out of the flags or
> overridden?
> 
> [...]
> 
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Michael:
 
After some more poking around, I found that the following command line
fixes the above problem without having to modify the source code:

    make fate SAMPLES=fate-suite/ CC_C="-c -Umain"

So maybe the path-of-least-resistance to resolve this is to just
update the FATE documentation page at
http://ffmpeg.mplayerhq.hu/fate.html to note that in a Windows
environment, with SDL installed, you need to use CC_C="-c -Umain"
on the make command(actually, you need to look at configure, see what the 
current
value of CC_C is, and add "-Umain").

A solution that would require somewhat more effort would modify
ffmpeg/tests/Makefile to accomplish the same thing when doing a
"make fate".  I'm OK with just updating the documentation.

Greg Wolfe, Kodak Alaris



More information about the ffmpeg-devel mailing list