[FFmpeg-devel] [PATCH] drawtext: fix hard dependency to lavc (timecode).

Nicolas George nicolas.george at normalesup.org
Thu Dec 29 15:51:40 CET 2011


Le nonidi 9 nivôse, an CCXX, Clément Bœsch a écrit :
> Is it ok to include libavcodec stuff and just avoid calling functions when
> it is disabled?

I do not think that building libavfilter separately from the ffmpeg source
tree is supported: therefore, including any header and using things that are
completely contained in the headers (structures definitions, macros, inline
functions, prototypes, etc.) is probably ok.

As for "avoid calling functions", is is not just that. If you write:

	if (avcodec_enabled)
	    foo();

then the compiler will generate code to call foo, and the linker will
complain that foo is not defined. On the other hand, if this time your test
uses AVCODEC_ENABLED, i.e., a build-time constant, then the compiler will
just not generate the code to call foo at all.

Note that theoretically, this will break on very very stupid compilers. But
obviously we do not really care, as this construct is used all over the
place, especially in allcodecs.c, allformats.c and co.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111229/9458fb55/attachment.asc>


More information about the ffmpeg-devel mailing list