summaryrefslogtreecommitdiff
path: root/cmdutils.c
diff options
context:
space:
mode:
authorDiego Pettenò <flameeyes@gmail.com>2008-10-22 10:36:34 +0000
committerDiego Pettenò <flameeyes@gmail.com>2008-10-22 10:36:34 +0000
commit2cd39dbf16579e6381dcb3ac962523727fe5cf4a (patch)
tree2880678b087a0b7268e3e8316c355fa6a39d2ba3 /cmdutils.c
parente3cc7d6fef3afe9e7ed5bd17332db086ff79270b (diff)
downloadffmpeg-2cd39dbf16579e6381dcb3ac962523727fe5cf4a.tar.gz
Include headers for optional libraries only when enabled.
Include the headers for libavfilter, libswscale and libpostproc when they are enabled (and thus linked in). Without this change, Sun Studio will fail to link FFmpeg since two inline functions defined in avfilter.h will have undefined references to non-inline libavfilter functions. Originally committed as revision 15665 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 5c6715dd13..f52f56e7e2 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -24,12 +24,20 @@
#include <errno.h>
#include <math.h>
+/* Include only the enabled headers since some compilers (namely, Sun
+ Studio) will not omit unused inline functions and create undefined
+ references to libraries that are not being built. */
+
#include "config.h"
#include "libavformat/avformat.h"
+#ifdef CONFIG_AVFILTER
#include "libavfilter/avfilter.h"
+#endif
#include "libavdevice/avdevice.h"
#include "libswscale/swscale.h"
+#ifdef CONFIG_POSTPROC
#include "libpostproc/postprocess.h"
+#endif
#include "libavutil/avstring.h"
#include "libavcodec/opt.h"
#include "cmdutils.h"