[MPlayer-cvslog] Re: CVS: main/postproc swscale_template.c, 1.116, 1.117

Tobias Diedrich ranma at tdiedrich.de
Tue Jun 28 00:30:18 CEST 2005

Tobias Diedrich wrote:

> It redefines "inline" as "inline __attribute__((always_inline))".
> If I add "#define inline inline __attribute__((always_inline))" at
> the top of swscale_template.c it works with gcc-3.3 and the MMX2
> code no longer segfaults.

Since reimar says it doesn't work for him, here is the patch and
exact gcc version + command line tested:

ranma at nukunuku:~/src/mplayer-cvs/main-rw/postproc$ dpkg -l gcc-3.3
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
ii  gcc-3.3        3.3.5-13       The GNU C compiler
ranma at nukunuku:~/src/mplayer-cvs/main-rw/postproc$ gcc --version
gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
ranma at nukunuku:~/src/mplayer-cvs/main-rw/postproc$ cvs -z3 diff -u swscale_template.c
ranma at mplayer.dev.hu's password: 
Index: swscale_template.c
RCS file: /cvsroot/mplayer/main/postproc/swscale_template.c,v
retrieving revision 1.117
diff -u -r1.117 swscale_template.c
--- swscale_template.c  24 Jun 2005 12:17:30 -0000      1.117
+++ swscale_template.c  27 Jun 2005 22:23:25 -0000
@@ -16,6 +16,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#define inline inline __attribute__((always_inline))
 #undef MOVNTQ
 #undef PAVGB
ranma at nukunuku:~/src/mplayer-cvs/main-rw/postproc$ make clean && make
rm -f *.o *.a *~ *.so cs_test swscale-example
gcc -c -I../libvo -I../../libvo -I/usr/X11R6/include -fno-PIC -g -O4 -march=athlon-xp -mcpu=athlon-xp -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=gnu99  -I. -I..  -I.. -o swscale.o swscale.c
gcc -c -I../libvo -I../../libvo -I/usr/X11R6/include -fno-PIC -g -O4 -march=athlon-xp -mcpu=athlon-xp -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=gnu99  -I. -I..  -I.. -o rgb2rgb.o rgb2rgb.c
In file included from rgb2rgb.c:12:
rgb2rgb.h: In function `yuv2rgb':
rgb2rgb.h:134: warning: implicit declaration of function `printf'
gcc -c -I../libvo -I../../libvo -I/usr/X11R6/include -fno-PIC -g -O4 -march=athlon-xp -mcpu=athlon-xp -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=gnu99  -I. -I..  -I.. -o yuv2rgb.o yuv2rgb.c
ar r libswscale.a swscale.o rgb2rgb.o yuv2rgb.o
ar: creating libswscale.a
true libswscale.a
ranma at nukunuku:~/src/mplayer-cvs/main-rw/postproc$ cd .. && make mplayer
gcc -I../libvo -I../../libvo -I/usr/X11R6/include -fno-PIC -g -O4 -march=athlon-xp -mcpu=athlon-xp -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=gnu99 -I.      -I/usr/include/freetype2   -I/usr/X11R6/include   -o mplayer mplayer.o mp_msg.o asxparser.o codec-cfg.o cpudetect.o edl.o find_sub.o m_config.o m_option.o m_struct.o parser-cfg.o playtree.o playtreeparser.o spudec.o sub_cc.o subreader.o vobsub.o  mixer.o parser-mpcmd.o subopt-helper.o  libvo/libvo.a libao2/libao2.a    libmpcodecs/libmpcodecs.a loader/libloader.a loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a libaf/libaf.a libmpdemux/libmpdemux.a input/libinput.a postproc/libswscale.a osdep/libosdep.a -Llibmpdvdkit2 -lmpdvdkit libavcodec/libavcodec.a libavformat/libavformat.a  -lmad  -ltheora -logg   -lmp3lame    -lpng -lz -lz -ljpeg -lasound -ldl -lpthread    -lfreetype -lz -ltermcap  -lnsl  -lungif    -lfontconfig     libfaad2/libfaad2.a  liba52/liba52.a libmpeg2/libmpeg2.a tremor/libvorbisidec.a   -lXv  -lXxf86vm -lXinerama -L/usr/X11R6/lib -lXext -lX11 -lnsl -lnsl            -laudio -lXt -L/usr/X11R6/lib -lXext -lX11 -lnsl    -Wl,-z,noexecstack     -lpthread -ldl -rdynamic   -lm 
ranma at nukunuku:~/src/mplayer-cvs/main-rw$ 

If I test the resulting binary on an Athlon XP, using
"mplayer -vf scale=800:-2 Sousei_no_Aquarion_11_\[l33t-raws\]\[7BB5B740\].avi"
it works without segfault, if I remove the define and repeat the
above steps I get the segfault.

Tobias						PGP: http://9ac7e0bc.uguu.de

More information about the MPlayer-cvslog mailing list