[PATCH] Add AV_CONFIG_* symbols for libav* libs to libavutil/avconfig.h, and make ffmpeg.c and ffplay.c include avconfig.h rather than config.h.

Stefano Sabatini stefano.sabatini-lala
Wed Mar 3 00:53:47 CET 2010


config.h should be never directly included by an application, not even
by an internal ff* tool.
---
 configure |   15 ++++++++++-----
 ffmpeg.c  |    2 +-
 ffplay.c  |    2 +-
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/configure b/configure
index 902332f..f307b47 100755
--- a/configure
+++ b/configure
@@ -874,14 +874,19 @@ COMPONENT_LIST="
     protocols
 "
 
-CONFIG_LIST="
-    $COMPONENT_LIST
-    aandct
+CONFIG_LIST_PUB='
+    avutil
     avcodec
+    avformat
     avdevice
     avfilter
+    swscale'
+
+CONFIG_LIST="
+    $COMPONENT_LIST
+    $CONFIG_LIST_PUB
+    aandct
     avfilter_lavf
-    avformat
     avisynth
     beos_netserver
     bzlib
@@ -933,7 +938,6 @@ CONFIG_LIST="
     small
     sram
     static
-    swscale
     swscale_alpha
     vaapi
     vdpau
@@ -3087,6 +3091,7 @@ cat > $TMPH <<EOF
 EOF
 
 print_config AV_HAVE_ $TMPH /dev/null $HAVE_LIST_PUB
+print_config AV_CONFIG_ $TMPH /dev/null $CONFIG_LIST_PUB
 
 echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
 
diff --git a/ffmpeg.c b/ffmpeg.c
index 4220c27..77b9e27 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -22,7 +22,6 @@
 /* needed for usleep() */
 #define _XOPEN_SOURCE 600
 
-#include "config.h"
 #include <ctype.h>
 #include <string.h>
 #include <math.h>
@@ -31,6 +30,7 @@
 #include <signal.h>
 #include <limits.h>
 #include <unistd.h>
+#include "libavutil/avconfig.h"
 #include "libavformat/avformat.h"
 #include "libavdevice/avdevice.h"
 #include "libswscale/swscale.h"
diff --git a/ffplay.c b/ffplay.c
index b6b185e..8072637 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -19,9 +19,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "config.h"
 #include <math.h>
 #include <limits.h>
+#include "libavutil/avconfig.h"
 #include "libavutil/avstring.h"
 #include "libavutil/pixdesc.h"
 #include "libavformat/avformat.h"
-- 
1.6.6.1


--uQr8t48UFsdbeI+V--



More information about the ffmpeg-devel mailing list