[Ffmpeg-devel] [PATCH] fix compilation when Snow ENcoder is disabled

Guillaume POIRIER gpoirier
Sat Aug 12 16:54:15 CEST 2006


Hi,

Michael Niedermayer wrote:
> Hi
> 
> On Thu, Aug 10, 2006 at 10:45:29AM +0200, Guillaume Poirier wrote:
>> Hi,
>> This commit:
>> http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/2006-June/002597.html
>> broke compilation when Snow encoder is disabled.
>>
>> The symptom as as follows:
>> libavcodec/libavcodec.a(snow.o)(.text+0xb422): In function `get_block_rd':
>> /usr/src/mplayer/mplayer/libavcodec/snow.c:3129: undefined reference
>> to `w53_32_c'
>> libavcodec/libavcodec.a(snow.o)(.text+0xb456):/usr/src/mplayer/mplayer/libavcodec/snow.c:3127:
>> undefined reference to `w97_32_c'
>> libavcodec/libavcodec.a(snow.o)(.text+0x14374): In function `encode_init':
>> /usr/src/mplayer/mplayer/libavcodec/snow.c:4064: undefined reference
>> to `h263_encode_init'
>>
>> My patch puts all functions used in the encoding process around #ifdef
>> CONFIG_SNOW_ENCODER pre-processor tests.
>> I don't know if it's the right way to go, as I'm not sure how tight
>> Snow encoding and decoding are.
>> It doesn't seem to break Snow decoding, though tests are welcome.
> 
> IMHO the better solution would be to put
> 
> #ifdef CONFIG_SNOW_ENCODER
> int w53_32_c(...);
> ...
> #else
> #define w53_32_c(...) assert(0)
> ...
> #endif
> 
> in the correct .h file


I get the idea. However, I don't seem to be able to come up with simple 
a solution residing in the .h that works[1] (but it's probably because I 
lack imagination).
The attached patch implements what you suggest in the .c files. It 
compiles and work on all gcc versions I have on hand.

Is it okay, or is the .h solution the only way to go?

Guillaume


[1] trying to solve the problem in the .h (such as in attached 
compile_fix_H_version.diff) leads to problems such as:

libavcodec/libavcodec.a(mjpeg.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(dsputil.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(mpeg12.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(eval.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(error_resilience.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(parser.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(pnm.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(h263.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(msmpeg4.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(h263dec.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(dsputil_mmx.o): In function 
`h263_encode_init':i386/../mpegvideo.h:916: multiple definition of 
`h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(asv1.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(cavs.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(cljr.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(cyuv.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(dv.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(4xm.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(h261.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(h264.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(indeo3.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(qdrw.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(qpeg.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(rv10.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(snow.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(svq1.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(vp3.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(vc1.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(vcr1.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(xl.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(mpegvideo.o): In function 
`h263_encode_init':/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
multiple definition of `h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
libavcodec/libavcodec.a(mpegvideo_mmx.o): In function 
`h263_encode_init':i386/../mpegvideo.h:916: multiple definition of 
`h263_encode_init'
libavcodec/libavcodec.a(utils.o):/home/guillaume/Prgm/mplayer/libavcodec/mpegvideo.h:916: 
first defined here
collect2: ld returned 1 exit status
make: *** [mplayer] Erreur 1
guillaume at moonlight:~/Prgm/mplayer$

-------------- next part --------------
A non-text attachment was scrubbed...
Name: compile_fix_with_encoders_disabled.diff
Type: text/x-patch
Size: 1087 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060812/c2b4d94c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compile_fix_H_version.diff
Type: text/x-patch
Size: 664 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060812/c2b4d94c/attachment-0001.bin>



More information about the ffmpeg-devel mailing list