On date Tuesday 2011-05-17 16:24:43 -0400, Ronald S. Bultje encoded: > Hi, > > On Tue, May 17, 2011 at 4:18 PM, Stefano Sabatini > <stefano.sabatini-l...@poste.it> wrote: > > On date Tuesday 2011-05-17 20:31:53 +0200, Diego Biurrun encoded: > >> Do not #include avfilter.h conditionally, #include (just) required headers. > >> --- > >> cmdutils.h | 10 ++++------ > >> 1 files changed, 4 insertions(+), 6 deletions(-) > >> > >> diff --git a/cmdutils.h b/cmdutils.h > >> index f97ea80..fef2774 100644 > >> --- a/cmdutils.h > >> +++ b/cmdutils.h > >> @@ -22,8 +22,11 @@ > >> #ifndef LIBAV_CMDUTILS_H > >> #define LIBAV_CMDUTILS_H > >> > >> -#include <inttypes.h> > >> +#include <stdint.h> > >> +#include <sys/types.h> > >> + > >> #include "libavcodec/avcodec.h" > >> +#include "libavfilter/avfilter.h" > >> #include "libavformat/avformat.h" > >> #include "libswscale/swscale.h" > >> > >> @@ -278,9 +281,6 @@ int64_t guess_correct_pts(PtsCorrectionContext *ctx, > >> int64_t pts, int64_t dts); > >> FILE *get_preset_file(char *filename, size_t filename_size, > >> const char *preset_name, int is_path, const char > >> *codec_name); > >> > >> -#if CONFIG_AVFILTER > >> -#include "libavfilter/avfilter.h" > >> - > >> typedef struct { > >> enum PixelFormat pix_fmt; > >> } FFSinkContext; > >> @@ -296,6 +296,4 @@ extern AVFilter ffsink; > >> int get_filtered_video_frame(AVFilterContext *sink, AVFrame *frame, > >> AVFilterBufferRef **picref, AVRational > >> *pts_tb); > >> > >> -#endif /* CONFIG_AVFILTER */ > >> - > > > > If libavfilter is not enabled (which is still possible, and for some > > specific purposes even recommended) the declared functions are not > > compiled, so not having the symbols defined in the binary is safer. > > Including a header has no effect on symbols, only if you use them.
Uhm, even in that case not including the function declarations will cause a compile error if the functions are erroneously called, which is better than a linking error, correct me if I'm wrong. _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel