]> git.sesse.net Git - vlc/commitdiff
* Fix ffmpeg include's
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 17 Nov 2006 23:34:45 +0000 (23:34 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Fri, 17 Nov 2006 23:34:45 +0000 (23:34 +0000)
configure.ac
modules/codec/ffmpeg/demux.c
modules/codec/ffmpeg/mux.c
modules/codec/ffmpeg/scale.c

index 983fc121532202bd6dc70be9e33c942f26e24f65..6186e9e5e47372abc939bb7a7219937d3188db01 100644 (file)
@@ -2739,6 +2739,12 @@ dnl Those options have to be here because the .pc can be bogus for ffmpeg previo
      VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavformat ${real_ffmpeg_tree}/libavformat/libavformat.a])
      VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libavformat])
    fi
+
+   if test -f "${real_ffmpeg_tree}/libswscale/libswscale.a"; then
+     AC_DEFINE(HAVE_LIBSWSCALE_TREE, 1, [Define if you have ffmpeg's libswscale.])
+     VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libswscale ${real_ffmpeg_tree}/libswscale/libswscale.a])
+     VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libswscale])
+   fi
 else    
     
 dnl Look for a ffmpeg-config (we are on debian )
@@ -2753,7 +2759,7 @@ dnl Look for a ffmpeg-config (we are on debian )
   AC_PATH_PROG(FFMPEG_CONFIG, ffmpeg-config, no, ${FFMPEG_PATH})
   if test "${FFMPEG_CONFIG}" != "no"
   then
-      AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
+    AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
     AC_CHECK_HEADERS(ffmpeg/avformat.h)
     AC_CHECK_HEADERS(ffmpeg/avutil.h)
     AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
@@ -2772,6 +2778,7 @@ dnl Trying with pkg-config
      AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
      AC_CHECK_HEADERS(ffmpeg/avformat.h)
      AC_CHECK_HEADERS(ffmpeg/avutil.h)
+     AC_CHECK_HEADERS(ffmpeg/swscale.h)
      AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
      if test "${SYS}" = "darwin"; then
         VLC_ADD_BUILTINS([ffmpeg])
@@ -2806,6 +2813,7 @@ dnl Trying with pkg-config
       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
       AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
       AC_CHECK_HEADERS(ffmpeg/avformat.h)
+      AC_CHECK_HEADERS(ffmpeg/swscale.h)
       AC_CHECK_HEADERS(ffmpeg/avutil.h)
       AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
 
@@ -2831,6 +2839,11 @@ dnl Trying with pkg-config
         VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lz]) ], [], [-lavcodec -lz $LDAVUTIL])
       LDFLAGS="${LDFLAGS_save}"
       CPPFLAGS="${CPPFLAGS_save}"
+
+      AC_CHECK_LIB(swscale, sws_getContext, [
+        VLC_ADD_LDFLAGS([ffmpeg],[-lswscale]) ], [], [-lavcodec $LDAVUTIL])
+      LDFLAGS="${LDFLAGS_save}"
+      CPPFLAGS="${CPPFLAGS_save}"
     ])
   fi
  fi 
index 42c03c1c1ee000ce1a8c8a217fba47ae66211fcd..fb35b9a7a1a444902e75a06202110c1ade86a61a 100644 (file)
@@ -34,7 +34,7 @@
 /* ffmpeg header */
 #ifdef HAVE_FFMPEG_AVFORMAT_H
 #   include <ffmpeg/avformat.h>
-#else
+#elif defined(HAVE_LIBAVFORMAT_TREE)
 #   include <avformat.h>
 #endif
 
index 9ed07f1eea071e7fb7356acde3a61290d52c1cc8..c15bca4b7c05384b03c759ef050604fce619e392 100644 (file)
@@ -33,7 +33,7 @@
 /* ffmpeg header */
 #ifdef HAVE_FFMPEG_AVFORMAT_H
 #   include <ffmpeg/avformat.h>
-#else
+#elif defined(HAVE_LIBAVFORMAT_TREE)
 #   include <avformat.h>
 #endif
 
index 692253f8658bb7583951c66c3d383c456fec8cdc..7ad1bc5fe418ecd4f0e71c499e982b4e5c7db98b 100644 (file)
@@ -37,7 +37,7 @@
 
 #ifdef HAVE_FFMPEG_SWSCALE_H
 #   include <ffmpeg/swscale.h>
-#else
+#elif defined(HAVE_LIBSWSCALE_TREE)
 #   include <swscale.h>
 #endif