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

Michael Niedermayer michaelni
Sat Aug 12 20:09:11 CEST 2006


On Sat, Aug 12, 2006 at 04:54:15PM +0200, Guillaume POIRIER wrote:
> 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).

whats the problem with

#ifdef CONFIG_ENCODER
 void h263_encode_init(MpegEncContext *s);
#else
#define h263_encode_init(x) assert(0)
#endif

or

#ifdef CONFIG_ENCODER
 void h263_encode_init(MpegEncContext *s);
#else
 static void h263_encode_init(MpegEncContext *s) {assert(0);}
#endif


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list