[Ffmpeg-devel] some quick questions about swscaler integration

Måns Rullgård mru
Fri Mar 17 15:14:16 CET 2006

Luca Abeni said:
> Hi M?ns,
> On Fri, 2006-03-17 at 13:54 +0000, M?ns Rullg?rd wrote:
> [...]
>> > I was more thinking about things like "#include <inttypes.h>" (in
>> > swscaler.c, for example) and similar, which are not needed if avcodec.h
>> > is included.
>> If swscaler.c needs things from inttypes.h, it should #include it.  Never
>> depend on some other file doing it for you.
> But it is my impression that a lot of files in libav{codec, format}
> depend on this kind of assumptions (avcodec.h providing inttypes.h, for
> example).
> For example, PRIx64 is used by a lot of files without including
> inttypes.h because avutil.h is in charge for providing it, no?

There may be files that implicitly make this assumption, but it is not a
decided practise.  All files (*.c and *.h) #including everything they
depend on makes for the least trouble in the long run.  If (unlikely)
all dependencies on inttypes.h were removed from avcodec.h, someone might
(rightly) decide to remove the #include <inttypes.h> from it.  This would
break compilation of any file that depends on avcodec.h having this #include.

Some morons will tell you that header files should never #include other
header files.  These people are hopelessly misguided and should be either
ignored or shot.

M?ns Rullg?rd
mru at inprovide.com

More information about the ffmpeg-devel mailing list