[MPlayer-dev-eng] [RFC] rc2 at the beginning of October

Uoti Urpala uoti.urpala at pp1.inet.fi
Tue Sep 18 20:10:52 CEST 2007


On Tue, 2007-09-18 at 18:22 +0200, Bernhard Rosenkraenzer wrote:
> Given rc2 will probably be around for a long time (at least if the interval 
> between the various -pre releases and -rc1 and now -rc2 is any indication), 
> gcc 4.3 will probably be released before the next mplayer - so it can't hurt 
> to be compatible with it.
> 
> Right now, building mplayer with gcc 4.3 snapshots results in
> 
> libavcodec/libavcodec.a(mpeg12.o): In function `mpeg_decode_slice':
> mpeg12.c:(.text+0x157c): undefined reference to `XVMC_init_block'
> libavcodec/libavcodec.a(snow.o): In function `encode_q_branch':
> snow.c:(.text+0xacb2): undefined reference to `ff_epzs_motion_search'
> snow.c:(.text+0xad8d): undefined reference to `ff_get_mb_score'
> collect2: ld returned 1 exit status
> 
> It looks like gcc 4.3 is kicking functions that are declared "inline" when 
> they can't be inlined because the code isn't available at link time - I've 
> attached an obvious (but probably suboptimal) patch that makes it work.

gcc 4.3 finally implements handling of non-static "inline" keyword
correctly according to C99, while the FFmpeg code in question is not
valid according to the standard. 4.3 will no longer generate a global
symbol for plain "inline" function definitions.

> It probably doesn't hurt performance on older compilers because I'd guess they 
> just ignore an "inline" statement when the code can't be inlined, but I 
> didn't run any benchmarks on it yet.

Your change can hurt performance if the function is used in places where
the inline definition is visible, as it will no longer be marked
"inline" there. The standard way to get the same effect in standard C as
the current code has under older gcc would be to use "extern inline",
but unfortunately that in turn will fail under the old gcc versions.

However you can get the same effect as "extern inline" in a way that
works under both: instead of

extern inline void foo(void);

write

void foo(void);
inline void foo(void);

This will generate a global definition in both standard C and under
older gcc. (Note that doing this isn't the right thing for all the
functions with error messages listed above - XVMC_init_block for example
does not seem to be used in any place where the definition would be
visible, so the "inline" specifier can be removed just as well.)




More information about the MPlayer-dev-eng mailing list